impressum datenschutz added
This commit is contained in:
@@ -421,6 +421,50 @@ export async function updateAuthorizationTemplate(req: AuthRequest, res: Respons
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== IMPRESSUM & WEBSITE-DATENSCHUTZ ====================
|
||||
|
||||
export async function getImprint(req: AuthRequest, res: Response) {
|
||||
try {
|
||||
const html = await appSettingService.getSetting('imprintHtml');
|
||||
res.json({ success: true, data: { html: html || '' } });
|
||||
} catch (error) {
|
||||
res.status(500).json({ success: false, error: 'Fehler beim Abrufen' });
|
||||
}
|
||||
}
|
||||
|
||||
export async function updateImprint(req: AuthRequest, res: Response) {
|
||||
try {
|
||||
const { html } = req.body;
|
||||
if (typeof html !== 'string') return res.status(400).json({ success: false, error: 'HTML-Inhalt erforderlich' });
|
||||
await appSettingService.setSetting('imprintHtml', html);
|
||||
await logChange({ req, action: 'UPDATE', resourceType: 'AppSetting', label: 'Impressum aktualisiert' });
|
||||
res.json({ success: true, message: 'Impressum gespeichert' });
|
||||
} catch (error) {
|
||||
res.status(500).json({ success: false, error: 'Fehler beim Speichern' });
|
||||
}
|
||||
}
|
||||
|
||||
export async function getWebsitePrivacyPolicy(req: AuthRequest, res: Response) {
|
||||
try {
|
||||
const html = await appSettingService.getSetting('websitePrivacyPolicyHtml');
|
||||
res.json({ success: true, data: { html: html || '' } });
|
||||
} catch (error) {
|
||||
res.status(500).json({ success: false, error: 'Fehler beim Abrufen' });
|
||||
}
|
||||
}
|
||||
|
||||
export async function updateWebsitePrivacyPolicy(req: AuthRequest, res: Response) {
|
||||
try {
|
||||
const { html } = req.body;
|
||||
if (typeof html !== 'string') return res.status(400).json({ success: false, error: 'HTML-Inhalt erforderlich' });
|
||||
await appSettingService.setSetting('websitePrivacyPolicyHtml', html);
|
||||
await logChange({ req, action: 'UPDATE', resourceType: 'AppSetting', label: 'Website-Datenschutzerklärung aktualisiert' });
|
||||
res.json({ success: true, message: 'Website-Datenschutzerklärung gespeichert' });
|
||||
} catch (error) {
|
||||
res.status(500).json({ success: false, error: 'Fehler beim Speichern' });
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== SEND CONSENT LINK ====================
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user