From efde006a71aa0c2fdee34d64f2d513527ee60a87 Mon Sep 17 00:00:00 2001 From: tsa96 Date: Sat, 2 Mar 2024 02:53:39 +0000 Subject: [PATCH] refactor(back): store status, credits and submission on static map list --- apps/backend/src/app/modules/maps/map-list.service.ts | 10 ++++++++-- libs/db/src/scripts/seed.ts | 11 +++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/apps/backend/src/app/modules/maps/map-list.service.ts b/apps/backend/src/app/modules/maps/map-list.service.ts index e3a691ca27..706f05fd79 100644 --- a/apps/backend/src/app/modules/maps/map-list.service.ts +++ b/apps/backend/src/app/modules/maps/map-list.service.ts @@ -71,10 +71,16 @@ export class MapListService implements OnModuleInit { fileName: true, hash: true, status: true, - createdAt: true, + images: true, thumbnail: true, + info: true, leaderboards: true, - info: true + credits: { include: { user: true } }, + submission: + type === FlatMapList.SUBMISSION + ? { include: { currentVersion: true } } + : undefined, + createdAt: true } }); diff --git a/libs/db/src/scripts/seed.ts b/libs/db/src/scripts/seed.ts index ae5d7be723..25cb572aaa 100644 --- a/libs/db/src/scripts/seed.ts +++ b/libs/db/src/scripts/seed.ts @@ -751,10 +751,17 @@ prismaWrapper(async (prisma: PrismaClient) => { name: true, fileName: true, hash: true, - createdAt: true, + status: true, + images: true, thumbnail: true, + info: true, leaderboards: true, - info: true + credits: { include: { user: true } }, + submission: + type === FlatMapList.SUBMISSION + ? { include: { currentVersion: true } } + : undefined, + createdAt: true } });