From 76a84be2935a1b958f832d32cf5269c30fefa56e Mon Sep 17 00:00:00 2001 From: ColinBuyck <53269332+ColinBuyck@users.noreply.github.com> Date: Mon, 25 Nov 2024 11:36:06 -0500 Subject: [PATCH] fix: handle copying app methods (#4491) * fix: handle copying app methods * fix: remove unrelated changes --- api/src/services/listing.service.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/api/src/services/listing.service.ts b/api/src/services/listing.service.ts index ff318342dc..d717e4831a 100644 --- a/api/src/services/listing.service.ts +++ b/api/src/services/listing.service.ts @@ -1001,6 +1001,21 @@ export class ListingService implements OnModuleInit { ordinal: unsavedImage.ordinal, })); + const applicationMethods = mappedListing.applicationMethods?.map( + (applicationMethod) => ({ + ...applicationMethod, + paperApplications: applicationMethod.paperApplications?.map( + (paperApplication) => ({ + ...paperApplication, + assets: { + fileId: paperApplication.assets.fileId, + label: paperApplication.assets.label, + }, + }), + ), + }), + ); + if (!dto.includeUnits) { delete mappedListing['units']; } @@ -1017,6 +1032,7 @@ export class ListingService implements OnModuleInit { ordinal: question.ordinal, })), listingImages: listingImages, + applicationMethods: applicationMethods, lotteryLastRunAt: undefined, lotteryLastPublishedAt: undefined, lotteryStatus: undefined,