เพิ่มฟิวคำสั่ง
This commit is contained in:
parent
90f754c0bd
commit
963a76df10
5 changed files with 51 additions and 3 deletions
|
|
@ -145,6 +145,10 @@ export class CommandController extends Controller {
|
|||
if (!commandType) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบประเภทคำสั่งนี้ในระบบ");
|
||||
}
|
||||
command.detailHeader = commandType.detailHeader;
|
||||
command.detailBody = commandType.detailBody;
|
||||
command.detailFooter = commandType.detailFooter;
|
||||
command.isAttachment = commandType.isAttachment;
|
||||
command.status = "DRAFT";
|
||||
command.issue = commandType.name;
|
||||
command.createdUserId = request.user.sub;
|
||||
|
|
|
|||
|
|
@ -39,8 +39,16 @@ export class CommandSysController extends Controller {
|
|||
@Get("list")
|
||||
async GetResult() {
|
||||
const _commandSys = await this.commandSysRepository.find({
|
||||
select: ["id", "sysName", "sysDescription", "createdAt", "lastUpdatedAt", "createdFullName", "lastUpdateFullName"],
|
||||
order: { id: "ASC" },
|
||||
select: [
|
||||
"id",
|
||||
"sysName",
|
||||
"sysDescription",
|
||||
"createdAt",
|
||||
"lastUpdatedAt",
|
||||
"createdFullName",
|
||||
"lastUpdateFullName",
|
||||
],
|
||||
order: { order: "ASC" },
|
||||
});
|
||||
return new HttpSuccess(_commandSys);
|
||||
}
|
||||
|
|
@ -79,7 +87,11 @@ export class CommandSysController extends Controller {
|
|||
) {
|
||||
const _commandSys = Object.assign(new CommandSys(), requestBody);
|
||||
const checkName = await this.commandSysRepository.findOne({
|
||||
where: { id: requestBody.id,sysName: requestBody.sysName,sysDescription: requestBody.sysDescription },
|
||||
where: {
|
||||
id: requestBody.id,
|
||||
sysName: requestBody.sysName,
|
||||
sysDescription: requestBody.sysDescription,
|
||||
},
|
||||
});
|
||||
|
||||
if (checkName) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue