Skip to content

Commit

Permalink
fix: pass licence plates into proper field
Browse files Browse the repository at this point in the history
  • Loading branch information
junminahn committed Sep 27, 2024
1 parent 05104ab commit 48eea32
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/core/services/public-cloud-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ export class PublicCloudRequestService extends ModelService<Prisma.PublicCloudRe
});

const licencePlates = res.map(({ licencePlate }) => 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' } },
],
};
Expand Down

0 comments on commit 48eea32

Please sign in to comment.