From 9fb421941809ce1449de7fdbc47d955395b48654 Mon Sep 17 00:00:00 2001 From: Primakov Alexandr Alexandrovich Date: Sat, 18 Jan 2025 16:52:10 +0300 Subject: [PATCH] todo list get list --- server/routers/todo/routes.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/routers/todo/routes.js b/server/routers/todo/routes.js index 8ae99d7..cf2139f 100644 --- a/server/routers/todo/routes.js +++ b/server/routers/todo/routes.js @@ -21,4 +21,14 @@ router.post('/', requiredValidate('title'), async (req, res) => { res.send(getAnswer(null, list)) }) +router.get('/list', async (req, res) => { + const items = await ListModel + .find({}) + .populate('items') + .exec() + + res.send(getAnswer(null, items)) +}) + + module.exports = router