feat: add status filter
This commit is contained in:
parent
bcd87c5fc5
commit
670349a4cf
1 changed files with 3 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ import {
|
|||
import HttpError from "../interfaces/http-error";
|
||||
import HttpStatus from "../interfaces/http-status";
|
||||
import { notFoundError } from "../utils/error";
|
||||
import { filterStatus } from "../services/prisma";
|
||||
|
||||
type WorkflowPayload = {
|
||||
name: string;
|
||||
|
|
@ -48,6 +49,7 @@ export class FlowTemplateController extends Controller {
|
|||
@Request() req: RequestWithUser,
|
||||
@Query() page: number = 1,
|
||||
@Query() pageSize: number = 30,
|
||||
@Query() status?: Status,
|
||||
@Query() query = "",
|
||||
) {
|
||||
const where = {
|
||||
|
|
@ -59,6 +61,7 @@ export class FlowTemplateController extends Controller {
|
|||
},
|
||||
},
|
||||
],
|
||||
...filterStatus(status),
|
||||
registeredBranch: {
|
||||
OR: permissionCondCompany(req.user),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue