From d708b42970b672e1ee4dcb8908ea4492b517f581 Mon Sep 17 00:00:00 2001 From: Bryann Yeap Kok Keong Date: Thu, 3 Nov 2022 17:38:29 +0800 Subject: [PATCH] [offers][fix] Fix profile showing wrong offers after editing --- apps/portal/src/mappers/offers-mappers.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/portal/src/mappers/offers-mappers.ts b/apps/portal/src/mappers/offers-mappers.ts index 9ce90cc1..60e519cb 100644 --- a/apps/portal/src/mappers/offers-mappers.ts +++ b/apps/portal/src/mappers/offers-mappers.ts @@ -461,11 +461,11 @@ export const profileOfferDtoMapper = ( location: locationDtoMapper(offer.location), monthYearReceived: offer.monthYearReceived, negotiationStrategy: offer.negotiationStrategy, - offersFullTime: offer.offersFullTime, - offersIntern: offer.offersIntern, + offersFullTime: null, + offersIntern: null, }; - if (offer.offersFullTime) { + if (offer.offersFullTime && offer.jobType === JobType.FULLTIME) { profileOfferDto.offersFullTime = { baseSalary: offer.offersFullTime?.baseSalary != null @@ -486,7 +486,7 @@ export const profileOfferDtoMapper = ( offer.offersFullTime.totalCompensation, ), }; - } else if (offer.offersIntern) { + } else if (offer.offersIntern && offer.jobType === JobType.INTERN) { profileOfferDto.offersIntern = { id: offer.offersIntern.id, internshipCycle: offer.offersIntern.internshipCycle,