feat(frontend): Navigatie voor leerpad geïmplementeerd.

This commit is contained in:
Gerald Schmittinger 2025-03-23 19:20:56 +01:00
parent 3c3fddb7d0
commit 07340de2e3
13 changed files with 216 additions and 54 deletions

View file

@ -0,0 +1,11 @@
import {InvalidResponseException, NotFoundException} from "@/services/api-client/api-exceptions.ts";
export function single<T>(list: T[]): T {
if (list.length === 1) {
return list[0];
} else if (list.length === 0) {
throw new NotFoundException("Expected list with exactly one element, but got an empty list.");
} else {
throw new InvalidResponseException(`Expected list with exactly one element, but got one with ${list.length} elements.`);
}
}