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 HttpError from "../interfaces/http-error";
|
||||||
import HttpStatus from "../interfaces/http-status";
|
import HttpStatus from "../interfaces/http-status";
|
||||||
import { notFoundError } from "../utils/error";
|
import { notFoundError } from "../utils/error";
|
||||||
|
import { filterStatus } from "../services/prisma";
|
||||||
|
|
||||||
type WorkflowPayload = {
|
type WorkflowPayload = {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
@ -48,6 +49,7 @@ export class FlowTemplateController extends Controller {
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Query() page: number = 1,
|
@Query() page: number = 1,
|
||||||
@Query() pageSize: number = 30,
|
@Query() pageSize: number = 30,
|
||||||
|
@Query() status?: Status,
|
||||||
@Query() query = "",
|
@Query() query = "",
|
||||||
) {
|
) {
|
||||||
const where = {
|
const where = {
|
||||||
|
|
@ -59,6 +61,7 @@ export class FlowTemplateController extends Controller {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
...filterStatus(status),
|
||||||
registeredBranch: {
|
registeredBranch: {
|
||||||
OR: permissionCondCompany(req.user),
|
OR: permissionCondCompany(req.user),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue