fix bug #2183
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m22s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m22s
This commit is contained in:
parent
6a07841763
commit
5ef5f7d4ed
2 changed files with 16 additions and 12 deletions
|
|
@ -4,20 +4,19 @@ import { Command } from "../entities/Command";
|
|||
|
||||
/**
|
||||
* เรียงลำดับผู้ได้รับคำสั่งใหม่หลังจากลบรายการ และอัพเดทสถานะคำสั่งถ้าไม่มีผู้ได้รับคำสั่งเหลือ
|
||||
* @param refId refId ของผู้ได้รับคำสั่ง
|
||||
* @param reciveId commandRecive.Id ของผู้ได้รับคำสั่ง
|
||||
* @param code ประเภทคำสั่ง
|
||||
* @returns Promise<void>
|
||||
*/
|
||||
export async function reOrderCommandRecivesAndDelete(
|
||||
refId: string
|
||||
reciveId: string
|
||||
): Promise<void> {
|
||||
const commandReciveRepo = AppDataSource.getRepository(CommandRecive);
|
||||
const commandRepo = AppDataSource.getRepository(Command);
|
||||
|
||||
// ค้นหาข้อมูลผู้ได้รับคำสั่งตาม refId
|
||||
// ค้นหาข้อมูลผู้ได้รับคำสั่งตาม reciveId
|
||||
const commandRecive = await commandReciveRepo.findOne({
|
||||
where: { refId: refId },
|
||||
relations: { command: true},
|
||||
where: { id: reciveId }
|
||||
});
|
||||
|
||||
if (commandRecive == null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue