Skip to content

Commit

Permalink
Merge pull request #3870 from bcgov/fix/v0.34.2
Browse files Browse the repository at this point in the history
fix: pass licence plates into proper field
  • Loading branch information
junminahn committed Sep 27, 2024
2 parents 968c604 + 48eea32 commit a0582b4
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 a0582b4

Please sign in to comment.