feat(260929-dzu): Einstellungen > Eigene Module fuer jeden Benutzer, Verwaltung nur gemeinsam
- gemeinsame Oberflaeche (CustomModuleManager, Formular, Loeschdialog) fuer Verwaltung und Einstellungen - Einstellungen: persoenliche Eintraege, Verwaltung sendet shared: true und zeigt nur gemeinsame - Navigation, Texte de/en, Komponententests Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,8 @@ export interface CustomModule {
|
||||
name: string;
|
||||
url: string;
|
||||
category: string;
|
||||
/** `true` = persoenlicher Eintrag des angemeldeten Benutzers, `false` = gemeinsam (vom Administrator). */
|
||||
personal: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
@@ -23,6 +25,14 @@ export interface CustomModuleInput {
|
||||
category: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Beim Anlegen: `shared: true` legt einen gemeinsamen Eintrag fuer alle an
|
||||
* (nur Administratoren, sonst 403); ohne das Feld ist der Eintrag persoenlich.
|
||||
*/
|
||||
export interface CustomModuleCreateInput extends CustomModuleInput {
|
||||
shared?: boolean;
|
||||
}
|
||||
|
||||
/** Fehler mit HTTP-Status und Servermeldung (falls vorhanden). */
|
||||
export class CustomModuleRequestError extends Error {
|
||||
constructor(
|
||||
@@ -83,7 +93,7 @@ export async function getCustomModule(id: string): Promise<CustomModule | null>
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export async function createCustomModule(input: CustomModuleInput): Promise<CustomModule> {
|
||||
export async function createCustomModule(input: CustomModuleCreateInput): Promise<CustomModule> {
|
||||
const res = await fetch(`${API_URL}/custom-modules`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
|
||||
Reference in New Issue
Block a user