Skip to content

Commit

Permalink
optional clan
Browse files Browse the repository at this point in the history
  • Loading branch information
arily committed Oct 12, 2023
1 parent aff62a8 commit e4e2385
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion prisma/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ model User {
clanPriv Int @default(0) @map("clan_priv") @db.TinyInt
apiKey String? @unique(map: "users_api_key_uindex") @map("api_key") @db.Char(36)
clan Clan @relation("clan", fields: [clanId], references: [id], onUpdate: NoAction, onDelete: NoAction)
clan Clan? @relation("clan", fields: [clanId], references: [id], onUpdate: NoAction, onDelete: NoAction)
favourites Favourite[]
ingameLogins IngameLogin[]
receivedMessages Mail[] @relation("receivedMessages")
Expand Down
4 changes: 2 additions & 2 deletions prisma/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ model User {
silenceEnd Int @default(0) @map("silence_end")
donorEnd Int @default(0) @map("donor_end")
creationTime Int @default(0) @map("creation_time")
lastActivity Int @default(0) @map("latest_activity")
lastActivity Int @default(0) @map("latest_activity")
preferredMode Int @default(0) @map("preferred_mode")
playStyle Int @default(0) @map("play_style")
customBadgeName String? @map("custom_badge_name") @db.VarChar(16)
Expand All @@ -31,7 +31,7 @@ model User {
clanPriv Int @default(0) @map("clan_priv") @db.TinyInt
apiKey String? @unique(map: "users_api_key_uindex") @map("api_key") @db.Char(36)
clan Clan @relation("clan", fields: [clanId], references: [id], onUpdate: NoAction, onDelete: NoAction)
clan Clan? @relation("clan", fields: [clanId], references: [id], onUpdate: NoAction, onDelete: NoAction)
favourites Favourite[]
ingameLogins IngameLogin[]
receivedMessages Mail[] @relation("receivedMessages")
Expand Down
4 changes: 2 additions & 2 deletions prisma/versioning/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ model User {
silenceEnd Int @default(0) @map("silence_end")
donorEnd Int @default(0) @map("donor_end")
creationTime Int @default(0) @map("creation_time")
lastActivity Int @default(0) @map("latest_activity")
lastActivity Int @default(0) @map("latest_activity")
preferredMode Int @default(0) @map("preferred_mode")
playStyle Int @default(0) @map("play_style")
customBadgeName String? @map("custom_badge_name") @db.VarChar(16)
Expand All @@ -30,7 +30,7 @@ model User {
clanPriv Int @default(0) @map("clan_priv") @db.TinyInt
apiKey String? @unique(map: "users_api_key_uindex") @map("api_key") @db.Char(36)
clan Clan @relation(name: "clan", fields: [clanId], references: [id])
clan Clan? @relation(name: "clan", fields: [clanId], references: [id])
favourites Favourite[]
ingameLogins IngameLogin[]
receivedMessages Mail[] @relation("receivedMessages")
Expand Down
4 changes: 2 additions & 2 deletions prisma/versioning/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ model User {
silenceEnd Int @default(0) @map("silence_end")
donorEnd Int @default(0) @map("donor_end")
creationTime Int @default(0) @map("creation_time")
lastActivity Int @default(0) @map("latest_activity")
lastActivity Int @default(0) @map("latest_activity")
preferredMode Int @default(0) @map("preferred_mode")
playStyle Int @default(0) @map("play_style")
customBadgeName String? @map("custom_badge_name") @db.VarChar(16)
Expand All @@ -30,7 +30,7 @@ model User {
clanPriv Int @default(0) @map("clan_priv") @db.TinyInt
apiKey String? @unique(map: "users_api_key_uindex") @map("api_key") @db.Char(36)
clan Clan @relation(name: "clan", fields: [clanId], references: [id])
clan Clan? @relation(name: "clan", fields: [clanId], references: [id])
favourites Favourite[]
ingameLogins IngameLogin[]
receivedMessages Mail[] @relation("receivedMessages")
Expand Down
2 changes: 1 addition & 1 deletion src/server/backend/$base/server/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export abstract class AdminProvider<Id> extends IdTransformable {
& {
registeredAt: Date
lastActivityAt: Date
clan: UserClan<Id>
clan?: UserClan<Id>
}
>>
}
4 changes: 2 additions & 2 deletions src/server/backend/bancho.py/server/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ export class AdminProvider extends Base<Id> implements Base<Id> {
status: UserStatus.Unknown,
lastActivityAt: new Date(user.lastActivity * 1000),
registeredAt: new Date(user.creationTime * 1000),
clan: {
clan: user.clan ? {
id: user.clan.id,
name: user.clan.name,
},
} : undefined,
}))

return uCompacts
Expand Down

0 comments on commit e4e2385

Please sign in to comment.