[offers][chore] Add location field to dashboard offer

ailing/undo-fix
Bryann Yeap Kok Keong 2 years ago
parent 59c836c45d
commit bd9a30f1f8

@ -763,6 +763,7 @@ export const addToProfileResponseMapper = (updatedProfile: {
export const dashboardOfferDtoMapper = (
offer: OffersOffer & {
company: Company;
location: City & { state: State & { country: Country } };
offersFullTime:
| (OffersFullTime & {
baseSalary: OffersCurrency | null;
@ -785,6 +786,7 @@ export const dashboardOfferDtoMapper = (
id: '',
value: -1,
}),
location: locationDtoMapper(offer.location),
monthYearReceived: offer.monthYearReceived,
profileId: offer.profileId,
title: offer.offersFullTime?.title || offer.offersIntern?.title || '',
@ -934,4 +936,4 @@ const userProfileOfferDtoMapper = (
}
return mappedOffer;
};
};

@ -78,6 +78,15 @@ export const offersRouter = createRouter().query('list', {
// Internship
include: {
company: true,
location: {
include: {
state: {
include: {
country: true,
},
},
},
},
offersFullTime: {
include: {
baseSalary: true,
@ -198,6 +207,15 @@ export const offersRouter = createRouter().query('list', {
// Junior, Mid, Senior
include: {
company: true,
location: {
include: {
state: {
include: {
country: true,
},
},
},
},
offersFullTime: {
include: {
baseSalary: true,
@ -397,4 +415,4 @@ export const offersRouter = createRouter().query('list', {
!yoeRange ? JobType.INTERN : JobType.FULLTIME,
);
},
});
});

@ -70,6 +70,7 @@ export type DashboardOffer = {
company: OffersCompany;
id: string;
income: Valuation;
location: Location;
monthYearReceived: Date;
profileId: string;
stocks?: Valuation;
@ -225,4 +226,4 @@ export type Location = {
countryName: string;
stateId: string;
stateName: string;
};
};

Loading…
Cancel
Save