Adding fixes that lets us pull a myster in the db into a json file

This commit is contained in:
2026-08-23 21:37:06 +02:00
parent 3c099a5daa
commit 7dec2994b4
8 changed files with 719 additions and 290 deletions
+8
View File
@@ -397,6 +397,14 @@ app.delete('/api/admin/npcs/:id/poses/:poseKey', requireAdmin, async (req, res,
app.get('/api/admin/level-templates', requireAdmin, async (_req, res, next) => {
try { res.json(await storyGraph.listLevelTemplates()) } catch (error) { next(error) }
})
// Read a frozen template version's board (exhibits, goals, rules) for the mystery:pull
// exporter — read-only, so no editing gate.
app.get('/api/admin/level-templates/:versionId/export', requireAdmin, async (req, res, next) => {
try {
const board = await levels.getTemplateBoard(String(req.params.versionId))
board ? res.json(board) : res.status(404).json({ error: 'Template version not found' })
} catch (error) { next(error) }
})
app.get('/api/admin/mysteries/:id/graph', requireAdmin, async (req, res, next) => {
try {
const graph = await storyGraph.getGraph(String(req.params.id))