This commit is contained in:
Primakov Alexandr Alexandrovich
2025-01-18 17:45:16 +03:00
parent d2d8b63aba
commit 86b79a7f49
7 changed files with 118 additions and 69 deletions

View File

@@ -51,7 +51,10 @@ router.post('/item', requiredValidate('todoId', 'title'), async (req, res) => {
router.get('/:todoId', async (req, res) => {
const { todoId } = req.params
const list = await ListModel.findById(todoId).populate('items').exec()
const list = await ListModel
.findById(todoId)
.populate('items')
.exec()
if (!list) {
throw new Error('list not found')