Compare commits

...

2 Commits

Author SHA1 Message Date
Primakov Alexandr Alexandrovich
afc782f50f check 2024-10-16 11:15:18 +03:00
Primakov Alexandr Alexandrovich
ff6e688206 fix 2024-10-16 11:12:16 +03:00

View File

@ -1,12 +1,12 @@
const { Router } = require('express')
const { ListModel } = require('../../data/model/todo/list')
const { ItemModel } = require('../../data/model/todo/Item')
const { ItemModel } = require('../../data/model/todo/item')
const { getAnswer } = require('../../utils/common')
const router = Router()
// http://localhost:8033/todo/list
// test - http://localhost:8033/todo/list
router.get('/list', async (req, res) => {
const items = await ListModel
.find({})
@ -16,7 +16,7 @@ router.get('/list', async (req, res) => {
res.send(getAnswer(null, items))
})
// http://localhost:8033/todo/list/create/new%20List%20Name
// test - http://localhost:8033/todo/list/create/new%20List%20Name
router.get('/list/create/:title', async (req, res) => {
const { title } = req.params
@ -25,7 +25,7 @@ router.get('/list/create/:title', async (req, res) => {
res.send(getAnswer(null, list))
})
// http://localhost:8033/todo/item/create/:listId/new%20one
// test - http://localhost:8033/todo/item/create/:listId/new%20one
router.get('/item/create/:listId/:name', async (req, res, next) => {
const { name, listId } = req.params