From 61aadabf4bf15c2efe9f2b376b60d79e2fc2bb19 Mon Sep 17 00:00:00 2001 From: "iga.Lukiewska@forlagshuset.no" Date: Tue, 18 Jul 2023 10:04:56 +0200 Subject: [PATCH] fix: rename keys in dto --- src/learning-path/dto/learning-path.dto.ts | 27 ++++++++++++++++------ test/data/learning-path-data.ts | 8 +++---- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/learning-path/dto/learning-path.dto.ts b/src/learning-path/dto/learning-path.dto.ts index efc5a13..afd0917 100644 --- a/src/learning-path/dto/learning-path.dto.ts +++ b/src/learning-path/dto/learning-path.dto.ts @@ -1,12 +1,25 @@ export interface LearningPathDto { - readonly _id: string; + readonly id: string; readonly name: string; readonly slug: string; - readonly metadata?: Record; - readonly fork_id?: string; + readonly metadata?: Metadata; + readonly forkId?: string; readonly status: string; - readonly created_namespace_id?: string; - readonly created_by: string; - readonly created_at: string; - readonly updated_at: string; + readonly namespaceId?: string; + readonly createdBy: string; + readonly createdAt: string; + readonly updatedAt: string; +} + +interface Metadata { + readonly description?: string; + readonly descriptionInstructor?: string; + readonly author?: string; + readonly coverId?: string; + readonly coverAlt?: string; + readonly coverCopyright?: string; + readonly bannerId?: string; + readonly bannerAlt?: string; + readonly bannerCopyright?: string; + readonly duration?: number; } diff --git a/test/data/learning-path-data.ts b/test/data/learning-path-data.ts index 4a6fe91..e071917 100644 --- a/test/data/learning-path-data.ts +++ b/test/data/learning-path-data.ts @@ -1,11 +1,11 @@ import { LearningPathDto } from '../../src/learning-path/dto/learning-path.dto'; export const learningPath: LearningPathDto = { - _id: 'b942d4de-921c-4406-abbd-464dabb7b323', + id: 'b942d4de-921c-4406-abbd-464dabb7b323', name: 'name', slug: 'slug', status: 'status', - created_by: 'created_by', - created_at: 'created_at', - updated_at: 'updated_at', + createdBy: 'created_by', + createdAt: 'created_at', + updatedAt: 'updated_at', };