fix ปลดจากกิ่ง ยกเว้นคำสั่ง25 26

This commit is contained in:
Bright 2024-10-28 18:01:36 +07:00
parent 2f378fa4a1
commit 1b3f42fd85
2 changed files with 18 additions and 2 deletions

View file

@ -175,6 +175,20 @@ export async function removeProfileInOrganize(profileId: string, type: string) {
}
}
export async function checkExceptCommandType(commandId: string) {
const commandRepository = AppDataSource.getRepository(Command);
const _type = await commandRepository.findOne({
where: {
id: commandId
},
relations: ["commandType"],
});
if (!["C-PM-25", "C-PM-26"].includes(String(_type?.commandType.code))) {
return false;
}
return true;
}
export async function checkCommandType(commandId: string) {
const commandRepository = AppDataSource.getRepository(Command);
const _type = await commandRepository.findOne({