This commit is contained in:
2025-11-17 14:36:32 +07:00
parent 33f8fce3e6
commit 05dfb9a39e
4 changed files with 20 additions and 13 deletions

View File

@@ -33,17 +33,20 @@ export class budgetAdd {
let id = req.body.request.bdgseq;
database = decoded.organization
aryResult = await this.budgetAddService.getBudgetAdd(database, id, name); // เช็คกับ db กลาง ส่ง jwttoken ออกมา
aryResult = await this.budgetAddService.getBudgetAdd(database, name); // เช็คกับ db กลาง ส่ง jwttoken ออกมา
// this.generalService.devhint(1, 'budgetSearch.js', 'Login success');
} catch (error) {
idx = 1;
} finally {
if (idx === 1) return sendError('เกิดข้อผิดพลาดไม่คาดคิดเกิดขึ้น', 'Unexpected error');
if (!aryResult) return sendError('ไม่พบการมีอยู่ของข้อมูล', 'Cannot Find Any Data');
// if (!aryResult) return sendError('ไม่พบการมีอยู่ของข้อมูล', 'Cannot Find Any Data');
if (aryResult == 0){
let prommis = await this.makeArySave(req);
return prommis
} else {
return sendError('คีย์หลักซ้ำในระบบ', 'Duplicate Primary Key');
}
}
}