mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2026-04-03 02:48:43 +08:00
[offers][chore] Add location field to dashboard offer
This commit is contained in:
@@ -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,
|
||||
);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
3
apps/portal/src/types/offers.d.ts
vendored
3
apps/portal/src/types/offers.d.ts
vendored
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user