no message

This commit is contained in:
kittapath 2024-11-14 14:58:31 +07:00
parent bc6e43a700
commit 5530c36f93
2 changed files with 24 additions and 8 deletions

View file

@ -942,4 +942,25 @@ export class OrganizationUnauthorizeController extends Controller {
if (val >= 90 && val <= 100) return "ดีเด่น";
else return "-";
}
/**
* API
*
* @summary
*
*/
@Get("active/root/all")
async GetActiveRootAll() {
const orgRevisionActive = await this.orgRevisionRepository.findOne({
where: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
});
if (!orgRevisionActive) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบโครงสร้างที่เผยแพร่อยู่ตอนนี้");
}
const data = await this.orgRootRepository.find({
where: { orgRevisionId: orgRevisionActive.id },
});
return new HttpSuccess(data);
}
}