From b40901018c407afc388cc8496421a36b041da2ae Mon Sep 17 00:00:00 2001 From: Dylan JUZAINE Date: Fri, 22 Nov 2024 18:27:05 +0100 Subject: [PATCH] feat(vil-612): fix lint error for activity content --- server/controllers/game.ts | 2 +- types/activity.type.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/server/controllers/game.ts b/server/controllers/game.ts index a57463e6c..679941c5e 100644 --- a/server/controllers/game.ts +++ b/server/controllers/game.ts @@ -401,7 +401,7 @@ gameController.get({ path: '/standardGame/:id', userType: UserType.TEACHER }, as } const id = parseInt(req.params.id, 10) || 0; const activity = await AppDataSource.getRepository(Activity).findOne({ where: { id } }); - const activityId = activity.id; + const activityId = activity?.id; if (!activity || (req.user.type === UserType.TEACHER && req.user.villageId !== activity.villageId)) { next(); return; diff --git a/types/activity.type.ts b/types/activity.type.ts index 94985cc76..76b3a8a93 100644 --- a/types/activity.type.ts +++ b/types/activity.type.ts @@ -3,6 +3,7 @@ export interface ActivityContent { id: number; // needed to sort content. type: ActivityContentType; value: string; + game?: unknown; } export type AnyData = Record;