mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
User.isAdmin as nullable Date
This commit is contained in:
parent
ba648c67a9
commit
fa6fbe38c8
@ -58,8 +58,8 @@ export class User {
|
||||
|
||||
// `passphrase` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||
|
||||
@Field(() => Boolean)
|
||||
isAdmin: boolean
|
||||
@Field(() => Date, { nullable: true })
|
||||
isAdmin: Date | null
|
||||
|
||||
// TODO this is a bit inconsistent with what we query from the database
|
||||
// therefore all those fields are now nullable with default value null
|
||||
|
||||
@ -30,7 +30,7 @@ export const userFactory = async (
|
||||
|
||||
if (user.createdAt) dbUser.createdAt = user.createdAt
|
||||
if (user.deletedAt) dbUser.deletedAt = user.deletedAt
|
||||
if (user.isAdmin) dbUser.isAdmin = user.isAdmin
|
||||
if (user.isAdmin) dbUser.isAdmin = new Date()
|
||||
await dbUser.save()
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ const communityDbUser: dbUser = {
|
||||
createdAt: new Date(),
|
||||
emailChecked: false,
|
||||
language: '',
|
||||
isAdmin: false,
|
||||
isAdmin: null,
|
||||
publisherId: 0,
|
||||
passphrase: '',
|
||||
settings: [],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user