update service and category
This commit is contained in:
@@ -48,6 +48,20 @@ export class UserSchema extends PothosSchema {
|
||||
bankAccountNumber: t.exposeString('bankAccountNumber', {
|
||||
description: 'The bank account number of the user.',
|
||||
}),
|
||||
packageValue: t.exposeFloat('packageValue', {
|
||||
description: 'The package value of the user.',
|
||||
validate: (value) => {
|
||||
if (typeof value !== 'number') {
|
||||
return false
|
||||
}
|
||||
// value can be only 0 to 1
|
||||
if (value < 0 || value > 1) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
nullable: true,
|
||||
}),
|
||||
role: t.exposeString('role', {
|
||||
nullable: true,
|
||||
description: 'The role of the user.',
|
||||
@@ -284,15 +298,16 @@ export class UserSchema extends PothosSchema {
|
||||
}
|
||||
|
||||
const buffer = Buffer.concat(chunks)
|
||||
const { id: userId, imageUrl } = await clerkClient.users.updateUserProfileImage(id, {
|
||||
file: new Blob([buffer]),
|
||||
});
|
||||
const { id: userId, imageUrl } =
|
||||
await clerkClient.users.updateUserProfileImage(id, {
|
||||
file: new Blob([buffer]),
|
||||
})
|
||||
await this.prisma.user.update({
|
||||
where: { id: userId },
|
||||
data: {
|
||||
avatarUrl: imageUrl,
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user