From b8db32161f633a1734a44614c670e4d7697b6e51 Mon Sep 17 00:00:00 2001 From: Gabriellvl Date: Fri, 7 Mar 2025 20:04:46 +0100 Subject: [PATCH] fix: consistente naamgeving kebab case --- ...{learningObjects.ts => learning-objects.ts} | 4 ++-- .../{learningPaths.ts => learning-paths.ts} | 2 +- backend/src/controllers/themes.ts | 2 +- .../entities/content/learning-object.entity.ts | 18 +++++++++--------- .../{learningPath.ts => learning-path.ts} | 0 backend/src/routes/learning-objects.ts | 2 +- backend/src/routes/learning-paths.ts | 2 +- ...{learningObjects.ts => learning-objects.ts} | 6 +++--- .../{learningPaths.ts => learning-paths.ts} | 4 ++-- .../src/util/{apiHelper.ts => api-helper.ts} | 0 ...nslationHelper.ts => translation-helper.ts} | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) rename backend/src/controllers/{learningObjects.ts => learning-objects.ts} (93%) rename backend/src/controllers/{learningPaths.ts => learning-paths.ts} (97%) rename backend/src/interfaces/{learningPath.ts => learning-path.ts} (100%) rename backend/src/services/{learningObjects.ts => learning-objects.ts} (96%) rename backend/src/services/{learningPaths.ts => learning-paths.ts} (93%) rename backend/src/util/{apiHelper.ts => api-helper.ts} (100%) rename backend/src/util/{translationHelper.ts => translation-helper.ts} (93%) diff --git a/backend/src/controllers/learningObjects.ts b/backend/src/controllers/learning-objects.ts similarity index 93% rename from backend/src/controllers/learningObjects.ts rename to backend/src/controllers/learning-objects.ts index 4295326a..c8a51734 100644 --- a/backend/src/controllers/learningObjects.ts +++ b/backend/src/controllers/learning-objects.ts @@ -3,9 +3,9 @@ import { getLearningObjectById, getLearningObjectIdsFromPath, getLearningObjectsFromPath, -} from '../services/learningObjects.js'; +} from '../services/learning-objects.js'; import { FALLBACK_LANG } from '../config.js'; -import { FilteredLearningObject } from '../interfaces/learningPath'; +import { FilteredLearningObject } from '../interfaces/learning-path'; export async function getAllLearningObjects( req: Request, diff --git a/backend/src/controllers/learningPaths.ts b/backend/src/controllers/learning-paths.ts similarity index 97% rename from backend/src/controllers/learningPaths.ts rename to backend/src/controllers/learning-paths.ts index 903451be..fb0fd07c 100644 --- a/backend/src/controllers/learningPaths.ts +++ b/backend/src/controllers/learning-paths.ts @@ -4,7 +4,7 @@ import { FALLBACK_LANG } from '../config.js'; import { fetchLearningPaths, searchLearningPaths, -} from '../services/learningPaths.js'; +} from '../services/learning-paths.js'; /** * Fetch learning paths based on query parameters. */ diff --git a/backend/src/controllers/themes.ts b/backend/src/controllers/themes.ts index 4b59751e..208b27d1 100644 --- a/backend/src/controllers/themes.ts +++ b/backend/src/controllers/themes.ts @@ -1,6 +1,6 @@ import { Request, Response } from 'express'; import { themes } from '../data/themes.js'; -import { loadTranslations } from "../util/translationHelper.js"; +import { loadTranslations } from "../util/translation-helper.js"; import { FALLBACK_LANG } from '../config.js'; interface Translations { diff --git a/backend/src/entities/content/learning-object.entity.ts b/backend/src/entities/content/learning-object.entity.ts index 179a2f5f..78d4aa00 100644 --- a/backend/src/entities/content/learning-object.entity.ts +++ b/backend/src/entities/content/learning-object.entity.ts @@ -13,6 +13,15 @@ import { Attachment } from './attachment.entity.js'; import { Teacher } from '../users/teacher.entity.js'; import { LearningObjectRepository } from '../../data/content/learning-object-repository.js'; +@Embeddable() +export class ReturnValue { + @Property({ type: 'string' }) + callbackUrl!: string; + + @Property({ type: 'json' }) + callbackSchema!: string; +} + @Entity({ repository: () => LearningObjectRepository }) export class LearningObject { @PrimaryKey({ type: 'string' }) @@ -88,15 +97,6 @@ export class EducationalGoal { id!: string; } -@Embeddable() -export class ReturnValue { - @Property({ type: 'string' }) - callbackUrl!: string; - - @Property({ type: 'json' }) - callbackSchema!: string; -} - export enum ContentType { Markdown = 'text/markdown', Image = 'image/image', diff --git a/backend/src/interfaces/learningPath.ts b/backend/src/interfaces/learning-path.ts similarity index 100% rename from backend/src/interfaces/learningPath.ts rename to backend/src/interfaces/learning-path.ts diff --git a/backend/src/routes/learning-objects.ts b/backend/src/routes/learning-objects.ts index 416602b5..3717095a 100644 --- a/backend/src/routes/learning-objects.ts +++ b/backend/src/routes/learning-objects.ts @@ -2,7 +2,7 @@ import express from 'express'; import { getAllLearningObjects, getLearningObject, -} from '../controllers/learningObjects.js'; +} from '../controllers/learning-objects.js'; const router = express.Router(); diff --git a/backend/src/routes/learning-paths.ts b/backend/src/routes/learning-paths.ts index ce580745..efe17312 100644 --- a/backend/src/routes/learning-paths.ts +++ b/backend/src/routes/learning-paths.ts @@ -1,5 +1,5 @@ import express from 'express'; -import { getLearningPaths } from '../controllers/learningPaths.js'; +import { getLearningPaths } from '../controllers/learning-paths.js'; const router = express.Router(); diff --git a/backend/src/services/learningObjects.ts b/backend/src/services/learning-objects.ts similarity index 96% rename from backend/src/services/learningObjects.ts rename to backend/src/services/learning-objects.ts index d1d34ad2..65ad11a6 100644 --- a/backend/src/services/learningObjects.ts +++ b/backend/src/services/learning-objects.ts @@ -1,12 +1,12 @@ import { DWENGO_API_BASE } from '../config.js'; -import { fetchWithLogging } from '../util/apiHelper.js'; +import { fetchWithLogging } from '../util/api-helper.js'; import { FilteredLearningObject, LearningObjectMetadata, LearningObjectNode, LearningPathResponse, -} from '../interfaces/learningPath.js'; -import { fetchLearningPaths } from './learningPaths.js'; +} from '../interfaces/learning-path.js'; +import { fetchLearningPaths } from './learning-paths.js'; function filterData( data: LearningObjectMetadata, diff --git a/backend/src/services/learningPaths.ts b/backend/src/services/learning-paths.ts similarity index 93% rename from backend/src/services/learningPaths.ts rename to backend/src/services/learning-paths.ts index 2a9f15a3..3353b58d 100644 --- a/backend/src/services/learningPaths.ts +++ b/backend/src/services/learning-paths.ts @@ -1,9 +1,9 @@ -import { fetchWithLogging } from '../util/apiHelper.js'; +import { fetchWithLogging } from '../util/api-helper.js'; import { DWENGO_API_BASE } from '../config.js'; import { LearningPath, LearningPathResponse, -} from '../interfaces/learningPath.js'; +} from '../interfaces/learning-path.js'; export async function fetchLearningPaths( hruids: string[], diff --git a/backend/src/util/apiHelper.ts b/backend/src/util/api-helper.ts similarity index 100% rename from backend/src/util/apiHelper.ts rename to backend/src/util/api-helper.ts diff --git a/backend/src/util/translationHelper.ts b/backend/src/util/translation-helper.ts similarity index 93% rename from backend/src/util/translationHelper.ts rename to backend/src/util/translation-helper.ts index f4443531..d6d842ff 100644 --- a/backend/src/util/translationHelper.ts +++ b/backend/src/util/translation-helper.ts @@ -1,7 +1,7 @@ import fs from 'fs'; import path from 'path'; import yaml from 'js-yaml'; -import {FALLBACK_LANG} from "../../config"; +import { FALLBACK_LANG } from "../config.js"; export function loadTranslations(language: string): T { try {