Update user.schema.ts

This commit is contained in:
Tyranno
2024-11-11 13:13:45 +07:00
committed by GitHub
parent 95a092cec9
commit 705c4b53d8

View File

@@ -284,9 +284,15 @@ export class UserSchema extends PothosSchema {
} }
const buffer = Buffer.concat(chunks) const buffer = Buffer.concat(chunks)
await clerkClient.users.updateUserProfileImage(id, { const { id: userId, imageUrl } = await clerkClient.users.updateUserProfileImage(id, {
file: new Blob([buffer]), file: new Blob([buffer]),
}) });
await this.prisma.user.update({
where: { id: userId },
data: {
avatarUrl: imageUrl,
},
});
} }
} }