[offers][fix] Fix profile showing wrong offers after editing

pull/500/head
Bryann Yeap Kok Keong 2 years ago
parent 3605c9fa63
commit d708b42970

@ -461,11 +461,11 @@ export const profileOfferDtoMapper = (
location: locationDtoMapper(offer.location), location: locationDtoMapper(offer.location),
monthYearReceived: offer.monthYearReceived, monthYearReceived: offer.monthYearReceived,
negotiationStrategy: offer.negotiationStrategy, negotiationStrategy: offer.negotiationStrategy,
offersFullTime: offer.offersFullTime, offersFullTime: null,
offersIntern: offer.offersIntern, offersIntern: null,
}; };
if (offer.offersFullTime) { if (offer.offersFullTime && offer.jobType === JobType.FULLTIME) {
profileOfferDto.offersFullTime = { profileOfferDto.offersFullTime = {
baseSalary: baseSalary:
offer.offersFullTime?.baseSalary != null offer.offersFullTime?.baseSalary != null
@ -486,7 +486,7 @@ export const profileOfferDtoMapper = (
offer.offersFullTime.totalCompensation, offer.offersFullTime.totalCompensation,
), ),
}; };
} else if (offer.offersIntern) { } else if (offer.offersIntern && offer.jobType === JobType.INTERN) {
profileOfferDto.offersIntern = { profileOfferDto.offersIntern = {
id: offer.offersIntern.id, id: offer.offersIntern.id,
internshipCycle: offer.offersIntern.internshipCycle, internshipCycle: offer.offersIntern.internshipCycle,

Loading…
Cancel
Save