feat: add active only query to flow template
This commit is contained in:
parent
a1f9271664
commit
11ed2b89ee
1 changed files with 3 additions and 2 deletions
|
|
@ -56,6 +56,7 @@ export class FlowTemplateController extends Controller {
|
|||
@Query() pageSize: number = 30,
|
||||
@Query() status?: Status,
|
||||
@Query() query = "",
|
||||
@Query() activeOnly?: boolean,
|
||||
) {
|
||||
const where = {
|
||||
OR: queryOrNot(query, [
|
||||
|
|
@ -67,9 +68,9 @@ export class FlowTemplateController extends Controller {
|
|||
},
|
||||
]),
|
||||
AND: {
|
||||
...filterStatus(status),
|
||||
...filterStatus(activeOnly ? Status.ACTIVE : status),
|
||||
registeredBranch: {
|
||||
OR: permissionCondCompany(req.user),
|
||||
OR: permissionCondCompany(req.user, { activeOnly: true }),
|
||||
},
|
||||
},
|
||||
} satisfies Prisma.WorkflowTemplateWhereInput;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue