diff --git a/apps/portal/src/mappers/offers-mappers.ts b/apps/portal/src/mappers/offers-mappers.ts index fa91fb9a..3b3542a7 100644 --- a/apps/portal/src/mappers/offers-mappers.ts +++ b/apps/portal/src/mappers/offers-mappers.ts @@ -773,7 +773,10 @@ export const dashboardOfferDtoMapper = ( }) | null; offersIntern: (OffersIntern & { monthlySalary: OffersCurrency }) | null; - profile: OffersProfile & { background: OffersBackground | null }; + profile: OffersProfile & { + background: OffersBackground | null; + offers: Array; + }; }, ) => { const dashboardOfferDto: DashboardOffer = { @@ -788,6 +791,8 @@ export const dashboardOfferDtoMapper = ( }), location: locationDtoMapper(offer.location), monthYearReceived: offer.monthYearReceived, + numberOfOtherOffers: + offer.profile.offers.length < 2 ? 0 : offer.profile.offers.length, profileId: offer.profileId, title: offer.offersFullTime?.title || offer.offersIntern?.title || '', totalYoe: offer.profile.background?.totalYoe ?? -1, diff --git a/apps/portal/src/server/router/offers/offers.ts b/apps/portal/src/server/router/offers/offers.ts index d775950f..ef425121 100644 --- a/apps/portal/src/server/router/offers/offers.ts +++ b/apps/portal/src/server/router/offers/offers.ts @@ -103,6 +103,7 @@ export const offersRouter = createRouter().query('list', { profile: { include: { background: true, + offers: true, }, }, }, @@ -232,6 +233,7 @@ export const offersRouter = createRouter().query('list', { profile: { include: { background: true, + offers: true, }, }, }, diff --git a/apps/portal/src/types/offers.d.ts b/apps/portal/src/types/offers.d.ts index e4f8892d..5faca2bb 100644 --- a/apps/portal/src/types/offers.d.ts +++ b/apps/portal/src/types/offers.d.ts @@ -72,6 +72,7 @@ export type DashboardOffer = { income: Valuation; location: Location; monthYearReceived: Date; + numberOfOtherOffers: number; profileId: string; stocks?: Valuation; title: string;