Skip to content

Commit

Permalink
fix(back): include full map submission versions in map submission pos…
Browse files Browse the repository at this point in the history
…t responses
  • Loading branch information
tsa96 committed Feb 10, 2024
1 parent 9d5b2d5 commit 301102d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion apps/backend-e2e/src/maps.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,10 @@ describe('Maps', () => {
versionNum: 2,
changelog
},
versions: [{ versionNum: 1 }, { versionNum: 2, changelog }]
versions: expect.arrayContaining([
expect.objectContaining({ versionNum: 1 }),
expect.objectContaining({ versionNum: 2, changelog })
])
});

const submissionDB = await prisma.mapSubmission.findUnique({
Expand Down
6 changes: 4 additions & 2 deletions apps/backend/src/app/modules/maps/maps.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ export class MapsService {
): Promise<MapDto> {
const map = await this.db.mMap.findUnique({
where: { id: mapID },
include: { submission: { include: { currentVersion: true } } }
include: {
submission: { include: { currentVersion: true, versions: true } }
}
});

if (!map) {
Expand Down Expand Up @@ -838,7 +840,7 @@ export class MapsService {
include: {
info: true,
stats: true,
submission: { include: { currentVersion: true } },
submission: { include: { currentVersion: true, versions: true } },
submitter: true,
images: true,
thumbnail: true,
Expand Down

0 comments on commit 301102d

Please sign in to comment.