|
|
@ -527,8 +527,10 @@ export const profileDtoMapper = (
|
|
|
|
offersIntern: (OffersIntern & { monthlySalary: OffersCurrency }) | null;
|
|
|
|
offersIntern: (OffersIntern & { monthlySalary: OffersCurrency }) | null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
>;
|
|
|
|
>;
|
|
|
|
|
|
|
|
user: User | null;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
inputToken: string | undefined,
|
|
|
|
inputToken: string | undefined,
|
|
|
|
|
|
|
|
inputUserId: string | null | undefined
|
|
|
|
) => {
|
|
|
|
) => {
|
|
|
|
const profileDto: Profile = {
|
|
|
|
const profileDto: Profile = {
|
|
|
|
analysis: profileAnalysisDtoMapper(profile.analysis),
|
|
|
|
analysis: profileAnalysisDtoMapper(profile.analysis),
|
|
|
@ -536,6 +538,7 @@ export const profileDtoMapper = (
|
|
|
|
editToken: null,
|
|
|
|
editToken: null,
|
|
|
|
id: profile.id,
|
|
|
|
id: profile.id,
|
|
|
|
isEditable: false,
|
|
|
|
isEditable: false,
|
|
|
|
|
|
|
|
isSaved: false,
|
|
|
|
offers: profile.offers.map((offer) => profileOfferDtoMapper(offer)),
|
|
|
|
offers: profile.offers.map((offer) => profileOfferDtoMapper(offer)),
|
|
|
|
profileName: profile.profileName,
|
|
|
|
profileName: profile.profileName,
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -543,6 +546,20 @@ export const profileDtoMapper = (
|
|
|
|
if (inputToken === profile.editToken) {
|
|
|
|
if (inputToken === profile.editToken) {
|
|
|
|
profileDto.editToken = profile.editToken ?? null;
|
|
|
|
profileDto.editToken = profile.editToken ?? null;
|
|
|
|
profileDto.isEditable = true;
|
|
|
|
profileDto.isEditable = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const users = profile.user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: BRYANN UNCOMMENT THIS ONCE U CHANGE THE SCHEMA
|
|
|
|
|
|
|
|
// for (let i = 0; i < users.length; i++) {
|
|
|
|
|
|
|
|
// if (users[i].id === inputUserId) {
|
|
|
|
|
|
|
|
// profileDto.isSaved = true
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: REMOVE THIS ONCE U CHANGE THE SCHEMA
|
|
|
|
|
|
|
|
if (users?.id === inputUserId) {
|
|
|
|
|
|
|
|
profileDto.isSaved = true
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return profileDto;
|
|
|
|
return profileDto;
|
|
|
|