fix bug #2183
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m22s

This commit is contained in:
harid 2026-03-12 14:53:45 +07:00
parent 6a07841763
commit 5ef5f7d4ed
2 changed files with 16 additions and 12 deletions

View file

@ -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)