Skip to content

Commit

Permalink
fix: handle copying app methods (#4491)
Browse files Browse the repository at this point in the history
* fix: handle copying app methods

* fix: remove unrelated changes
  • Loading branch information
ColinBuyck authored Nov 25, 2024
1 parent a1e79a5 commit 76a84be
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions api/src/services/listing.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}
Expand All @@ -1017,6 +1032,7 @@ export class ListingService implements OnModuleInit {
ordinal: question.ordinal,
})),
listingImages: listingImages,
applicationMethods: applicationMethods,
lotteryLastRunAt: undefined,
lotteryLastPublishedAt: undefined,
lotteryStatus: undefined,
Expand Down

0 comments on commit 76a84be

Please sign in to comment.