....
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user