no message
This commit is contained in:
parent
34d988b8a4
commit
e4d7c034e8
1 changed files with 9 additions and 2 deletions
|
|
@ -93,7 +93,10 @@ export class SubDistrictController extends Controller {
|
|||
}
|
||||
|
||||
const checkName = await this.subDistrictRepository.findOne({
|
||||
where: { name: requestBody.name },
|
||||
where: {
|
||||
name: requestBody.name,
|
||||
districtId: requestBody.districtId
|
||||
},
|
||||
});
|
||||
|
||||
if (checkName) {
|
||||
|
|
@ -135,7 +138,11 @@ export class SubDistrictController extends Controller {
|
|||
}
|
||||
|
||||
const checkName = await this.subDistrictRepository.findOne({
|
||||
where: { id: Not(id), name: requestBody.name },
|
||||
where: {
|
||||
id: Not(id),
|
||||
name: requestBody.name,
|
||||
districtId: requestBody.districtId
|
||||
},
|
||||
});
|
||||
if (checkName) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อนี้มีอยู่ในระบบแล้ว");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue