feat: add toggle on and off status
This commit is contained in:
parent
43d78e7db8
commit
a18d56503d
1 changed files with 4 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ import {
|
|||
} from "tsoa";
|
||||
import { RequestWithUser } from "../interfaces/user";
|
||||
import prisma from "../db";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { Prisma, Status } from "@prisma/client";
|
||||
import {
|
||||
branchRelationPermInclude,
|
||||
createPermCheck,
|
||||
|
|
@ -33,6 +33,7 @@ type WorkflowPayload = {
|
|||
responsiblePersonId?: string[];
|
||||
}[];
|
||||
registeredBranchId?: string;
|
||||
status?: Status;
|
||||
};
|
||||
|
||||
const permissionCondCompany = createPermCondition((_) => true);
|
||||
|
|
@ -75,7 +76,7 @@ export class FlowTemplateController extends Controller {
|
|||
},
|
||||
},
|
||||
},
|
||||
orderBy: { createdAt: "asc" },
|
||||
orderBy: [{ statusOrder: "asc" }, { createdAt: "asc" }],
|
||||
take: pageSize,
|
||||
skip: (page - 1) * pageSize,
|
||||
}),
|
||||
|
|
@ -170,6 +171,7 @@ export class FlowTemplateController extends Controller {
|
|||
where: { id: templateId },
|
||||
data: {
|
||||
...body,
|
||||
statusOrder: +(body.status === "INACTIVE"),
|
||||
step: {
|
||||
create: body.step.map((v, i) => ({
|
||||
type: v.type,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue