Full document, spreadsheet, slideshow, and diagram tooling
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: landing page fails to load documents (#151)

scott 3c4d705a a0db69b4

+5 -5
+5 -5
server/index.ts
··· 232 232 res.json(stmts.getAll.all() as DocumentListRow[]); 233 233 }); 234 234 235 + // Trash list MUST be registered before :id to avoid "trash" matching as a document ID 236 + app.get('/api/documents/trash', (_req: Request, res: Response) => { 237 + res.json(stmts.getTrash.all() as DocumentListRow[]); 238 + }); 239 + 235 240 app.get('/api/documents/:id', (req: Request<{ id: string }>, res: Response) => { 236 241 const doc = stmts.getOne.get(req.params.id) as DocumentListRow | undefined; 237 242 if (!doc) { res.status(404).json({ error: 'Not found' }); return; } ··· 241 246 app.delete('/api/documents/:id', (req: Request<{ id: string }>, res: Response) => { 242 247 stmts.deleteDoc.run(req.params.id); 243 248 res.json({ ok: true }); 244 - }); 245 - 246 - // --- Trash --- 247 - app.get('/api/documents/trash', (_req: Request, res: Response) => { 248 - res.json(stmts.getTrash.all() as DocumentListRow[]); 249 249 }); 250 250 251 251 app.put('/api/documents/:id/trash', (req: Request<{ id: string }>, res: Response) => {