adding chat features, admin features and bug fixes
This commit is contained in:
@@ -40,6 +40,24 @@ class BookStackController {
|
||||
res.status(500).json({ success: false, message: 'BookStack-Suche fehlgeschlagen' });
|
||||
}
|
||||
}
|
||||
async getPage(req: Request, res: Response): Promise<void> {
|
||||
if (!environment.bookstack.url) {
|
||||
res.status(200).json({ success: true, data: null, configured: false });
|
||||
return;
|
||||
}
|
||||
const id = parseInt(String(req.params.id), 10);
|
||||
if (isNaN(id) || id <= 0) {
|
||||
res.status(400).json({ success: false, message: 'Ungültige Seiten-ID' });
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const page = await bookstackService.getPageById(id);
|
||||
res.status(200).json({ success: true, data: page, configured: true });
|
||||
} catch (error) {
|
||||
logger.error('BookStackController.getPage error', { error });
|
||||
res.status(500).json({ success: false, message: 'BookStack-Seite konnte nicht geladen werden' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default new BookStackController();
|
||||
|
||||
Reference in New Issue
Block a user