เช็คเงื่อนไขการลบ

This commit is contained in:
Kittapath 2024-06-10 10:17:37 +07:00
parent c75c3ef651
commit 8348c32e5b
17 changed files with 54 additions and 57 deletions

View file

@ -201,7 +201,7 @@ export class ProfileChangeNameController extends Controller {
const result = await this.changeNameRepository.delete({ id: changeNameId });
if (result.affected && result.affected <= 0) {
if (result.affected == undefined || result.affected <= 0) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
}