feat: add ready to task filter
This commit is contained in:
parent
9b2db72c4d
commit
a86035a003
1 changed files with 16 additions and 1 deletions
|
|
@ -183,9 +183,24 @@ export class RequestListController extends Controller {
|
||||||
@Query() pageSize: number = 30,
|
@Query() pageSize: number = 30,
|
||||||
@Query() requestDataId?: string,
|
@Query() requestDataId?: string,
|
||||||
@Query() workStatus?: RequestWorkStatus,
|
@Query() workStatus?: RequestWorkStatus,
|
||||||
|
@Query() readyToTask?: boolean,
|
||||||
) {
|
) {
|
||||||
|
let statusCondition: Prisma.RequestWorkWhereInput["stepStatus"] = {};
|
||||||
|
|
||||||
|
if (readyToTask) {
|
||||||
|
statusCondition = {
|
||||||
|
some: {
|
||||||
|
OR: [{ workStatus: RequestWorkStatus.Ready }, { workStatus: RequestWorkStatus.Redo }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
statusCondition = {
|
||||||
|
some: { workStatus },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const where = {
|
const where = {
|
||||||
stepStatus: workStatus ? { some: { workStatus } } : undefined,
|
stepStatus: workStatus ? statusCondition : undefined,
|
||||||
request: {
|
request: {
|
||||||
id: requestDataId,
|
id: requestDataId,
|
||||||
quotation: {
|
quotation: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue