[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 = ( export const dashboardOfferDtoMapper = (
offer: OffersOffer & { offer: OffersOffer & {
company: Company; company: Company;
location: City & { state: State & { country: Country } };
offersFullTime: offersFullTime:
| (OffersFullTime & { | (OffersFullTime & {
baseSalary: OffersCurrency | null; baseSalary: OffersCurrency | null;
@ -785,6 +786,7 @@ export const dashboardOfferDtoMapper = (
id: '', id: '',
value: -1, value: -1,
}), }),
location: locationDtoMapper(offer.location),
monthYearReceived: offer.monthYearReceived, monthYearReceived: offer.monthYearReceived,
profileId: offer.profileId, profileId: offer.profileId,
title: offer.offersFullTime?.title || offer.offersIntern?.title || '', title: offer.offersFullTime?.title || offer.offersIntern?.title || '',

@ -78,6 +78,15 @@ export const offersRouter = createRouter().query('list', {
// Internship // Internship
include: { include: {
company: true, company: true,
location: {
include: {
state: {
include: {
country: true,
},
},
},
},
offersFullTime: { offersFullTime: {
include: { include: {
baseSalary: true, baseSalary: true,
@ -198,6 +207,15 @@ export const offersRouter = createRouter().query('list', {
// Junior, Mid, Senior // Junior, Mid, Senior
include: { include: {
company: true, company: true,
location: {
include: {
state: {
include: {
country: true,
},
},
},
},
offersFullTime: { offersFullTime: {
include: { include: {
baseSalary: true, baseSalary: true,

@ -70,6 +70,7 @@ export type DashboardOffer = {
company: OffersCompany; company: OffersCompany;
id: string; id: string;
income: Valuation; income: Valuation;
location: Location;
monthYearReceived: Date; monthYearReceived: Date;
profileId: string; profileId: string;
stocks?: Valuation; stocks?: Valuation;

Loading…
Cancel
Save