修复错误捕获
This commit is contained in:
@@ -24,7 +24,7 @@ export class UserService {
|
||||
async create(user: Partial<User>): Promise<User> {
|
||||
try {
|
||||
const newUser = this.userRepository.create(user);
|
||||
return this.userRepository.save(newUser);
|
||||
return await this.userRepository.save(newUser);
|
||||
} catch (error) {
|
||||
if (error instanceof QueryFailedError) {
|
||||
throw new ConflictException(this.getDuplicateErrorMessage(error));
|
||||
|
||||
Reference in New Issue
Block a user