Skip to content

Commit

Permalink
Merge db0eb4f into 49de86f
Browse files Browse the repository at this point in the history
  • Loading branch information
garrappachc authored Mar 8, 2021
2 parents 49de86f + db0eb4f commit a24e010
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions e2e/players.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ describe('PlayersController (e2e)', () => {
etf2lProfileId: 112758,
name: 'maly',
joinedAt: maly.joinedAt.toISOString(),
hasAcceptedRules: false,
avatar: {
small: 'small_avatar_url',
medium: 'medium_avatar_url',
Expand All @@ -87,7 +86,6 @@ describe('PlayersController (e2e)', () => {
etf2lProfileId: 112758,
name: 'maly',
joinedAt: maly.joinedAt.toISOString(),
hasAcceptedRules: false,
avatar: {
small: 'small_avatar_url',
medium: 'medium_avatar_url',
Expand Down
3 changes: 2 additions & 1 deletion src/players/models/player.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MongooseDocument } from '@/utils/mongoose-document';
import { prop, index } from '@typegoose/typegoose';
import { Expose, Transform, Type } from 'class-transformer';
import { Exclude, Expose, Transform, Type } from 'class-transformer';
import { IsString, Matches } from 'class-validator';
import { PlayerAvatar } from './player-avatar';
import { PlayerRole } from './player-role';
Expand Down Expand Up @@ -31,6 +31,7 @@ export class Player extends MongooseDocument {
@prop()
role?: PlayerRole;

@Exclude({ toPlainOnly: true })
@prop({ default: false })
hasAcceptedRules?: boolean;

Expand Down
1 change: 0 additions & 1 deletion src/profile/controllers/profile.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ describe('Profile Controller', () => {
id: 'FAKE_ID',
name: 'FAKE_USER_NAME',
steamId: 'FAKE_STEAM_ID',
hasAcceptedRules: false,
},
activeGameId: null,
bans: [],
Expand Down
3 changes: 3 additions & 0 deletions src/profile/dto/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class Profile {
this.bans = params.bans;
this.mapVote = params.mapVote;
this.preferences = params.preferences;
this.hasAcceptedRules = params.player.hasAcceptedRules;
}

@Type(() => Player)
Expand All @@ -34,4 +35,6 @@ export class Profile {
@Type(() => String)
preferences: PreferencesType;

hasAcceptedRules: boolean;

}

0 comments on commit a24e010

Please sign in to comment.