diff --git a/src/components/Nav.svelte b/src/components/Nav.svelte index 95df642..96c544f 100644 --- a/src/components/Nav.svelte +++ b/src/components/Nav.svelte @@ -15,13 +15,16 @@ diff --git a/src/routes/a/[slug].json.js b/src/routes/a/[slug].json.js index ac7baef..dd14603 100644 --- a/src/routes/a/[slug].json.js +++ b/src/routes/a/[slug].json.js @@ -55,8 +55,14 @@ export async function del(req, res, next) { const article = await Article.findOneAndDelete({ slug }); if (article) { - res.writeHead(204); - res.end(); + const articles = await Article.find() + .sort({ created_at: 'desc' }) + .populate({ path: 'category' }) + .populate({ path: 'author', select: 'realname' }); + res.writeHead(200, { + 'Content-Type': 'application/json' + }); + res.end(JSON.stringify({ category: 'all', articles })); } else { res.writeHead(404, { 'Content-Type': 'application/json' diff --git a/src/routes/a/[slug].svelte b/src/routes/a/[slug].svelte index c813e00..6543848 100644 --- a/src/routes/a/[slug].svelte +++ b/src/routes/a/[slug].svelte @@ -142,7 +142,7 @@