Merge remote-tracking branch 'origin/dev' into feat/pagina-om-leerpaden-te-bekijken-#41
# Conflicts: # backend/src/controllers/learning-objects.ts # frontend/src/controllers/base-controller.ts
This commit is contained in:
commit
99dc346dc1
155 changed files with 3463 additions and 2931 deletions
|
@ -2,12 +2,12 @@ import { ThemeController } from "@/controllers/themes.ts";
|
|||
import {LearningObjectController} from "@/controllers/learning-objects.ts";
|
||||
import {LearningPathController} from "@/controllers/learning-paths.ts";
|
||||
|
||||
export function controllerGetter<T>(Factory: new () => T): () => T {
|
||||
export function controllerGetter<T>(factory: new () => T): () => T {
|
||||
let instance: T | undefined;
|
||||
|
||||
return (): T => {
|
||||
if (!instance) {
|
||||
instance = new Factory();
|
||||
instance = new factory();
|
||||
}
|
||||
return instance;
|
||||
};
|
||||
|
|
|
@ -5,12 +5,12 @@ export class ThemeController extends BaseController {
|
|||
super("theme");
|
||||
}
|
||||
|
||||
getAll(language: string | null = null) {
|
||||
async getAll(language: string | null = null): Promise<unknown> {
|
||||
const query = language ? { language } : undefined;
|
||||
return this.get<any[]>("/", query);
|
||||
return this.get("/", query);
|
||||
}
|
||||
|
||||
getHruidsByKey(themeKey: string) {
|
||||
async getHruidsByKey(themeKey: string): Promise<string[]> {
|
||||
return this.get<string[]>(`/${encodeURIComponent(themeKey)}`);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue