chuc mung ban da duoc ban
This commit is contained in:
Submodule epess-database updated: 12f135fc8e...aa79d56d50
2263
package-lock.json
generated
2263
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -117,6 +117,9 @@ export class UserSchema extends PothosSchema {
|
|||||||
adminNote: t.relation('adminNote', {
|
adminNote: t.relation('adminNote', {
|
||||||
description: 'The admin note of the user.',
|
description: 'The admin note of the user.',
|
||||||
}),
|
}),
|
||||||
|
banned: t.exposeBoolean('banned', {
|
||||||
|
description: 'The banned status of the user.',
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -540,6 +543,13 @@ export class UserSchema extends PothosSchema {
|
|||||||
}
|
}
|
||||||
// ban user from clerk
|
// ban user from clerk
|
||||||
await clerkClient.users.banUser(args.userId)
|
await clerkClient.users.banUser(args.userId)
|
||||||
|
// invalidate cache
|
||||||
|
await ctx.http.invalidateCache()
|
||||||
|
// update user banned status
|
||||||
|
await this.prisma.user.update({
|
||||||
|
where: { id: args.userId },
|
||||||
|
data: { banned: true },
|
||||||
|
})
|
||||||
return 'Banned'
|
return 'Banned'
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user