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

This commit is contained in:
Bryann Yeap Kok Keong
2022-11-07 13:49:29 +08:00
parent 59c836c45d
commit bd9a30f1f8
3 changed files with 24 additions and 3 deletions

View File

@@ -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;
};
};

View File

@@ -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,
);
},
});
});

View File

@@ -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;
};
};