From 48eea32a8edf2d7002463156917486704b00c8e6 Mon Sep 17 00:00:00 2001 From: "j.dev" Date: Thu, 26 Sep 2024 17:20:04 -0700 Subject: [PATCH] fix: pass licence plates into proper field --- app/core/services/public-cloud-request.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/core/services/public-cloud-request.ts b/app/core/services/public-cloud-request.ts index 414503ad2..52cdc0a4d 100644 --- a/app/core/services/public-cloud-request.ts +++ b/app/core/services/public-cloud-request.ts @@ -30,14 +30,13 @@ export class PublicCloudRequestService extends ModelService licencePlate); - const mouRelatedRequestIds = this.session.tasks + const licencePlatesFromTasks = this.session.tasks .filter((task) => [TaskType.SIGN_MOU, TaskType.REVIEW_MOU].includes(task.type)) .map((task) => (task.data as { licencePlate: string }).licencePlate); const baseFilter: Prisma.PublicCloudRequestWhereInput = { OR: [ - { licencePlate: { in: licencePlates } }, - { id: { in: mouRelatedRequestIds } }, + { licencePlate: { in: [...licencePlates, ...licencePlatesFromTasks] } }, { type: RequestType.CREATE, createdByEmail: { equals: this.session.user.email, mode: 'insensitive' } }, ], };