Add robot tests

This commit is contained in:
2023-03-23 16:45:37 +09:00
committed by Bluub
parent a0bf718e1d
commit f24e43a392
2 changed files with 45 additions and 0 deletions
+4
View File
@@ -56,6 +56,10 @@ export class UsersService {
data: Prisma.UserUpdateInput;
}): Promise<User> {
const { where, data } = params;
if (typeof data.password === 'string')
data.password = await bcrypt.hash(data.password, 8);
else if (data.password && data.password.set)
data.password = await bcrypt.hash(data.password.set, 8);
return this.prisma.user.update({
data,
where,