mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-11 17:29:37 +02:00
feat: add global todo API with full CRUD, subtasks, priority, in-progress, and due date management.
This commit is contained in:
1 parent
ef6a8c7b4a
commit
56b257421c
1 file changed
+9
-9
@@ -54,10 +54,10 @@ router.get('/', async (req, res) => {
|
|||||||
router.post('/',
|
router.post('/',
|
||||||
[
|
[
|
||||||
body('text').trim().notEmpty().withMessage('Le texte est requis'),
|
body('text').trim().notEmpty().withMessage('Le texte est requis'),
|
||||||
body('parent_id').optional().isInt(),
|
body('parent_id').optional({ values: 'null' }).isInt(),
|
||||||
body('priority').optional().isBoolean(),
|
body('priority').optional({ values: 'null' }).isBoolean(),
|
||||||
body('in_progress').optional().isBoolean(),
|
body('in_progress').optional({ values: 'null' }).isBoolean(),
|
||||||
body('due_date').optional().isISO8601()
|
body('due_date').optional({ values: 'null' }).isISO8601()
|
||||||
],
|
],
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
try {
|
try {
|
||||||
@@ -112,11 +112,11 @@ router.post('/',
|
|||||||
*/
|
*/
|
||||||
router.put('/:id',
|
router.put('/:id',
|
||||||
[
|
[
|
||||||
body('text').optional().trim().notEmpty(),
|
body('text').optional({ values: 'null' }).trim().notEmpty(),
|
||||||
body('completed').optional().isBoolean(),
|
body('completed').optional({ values: 'null' }).isBoolean(),
|
||||||
body('priority').optional().isBoolean(),
|
body('priority').optional({ values: 'null' }).isBoolean(),
|
||||||
body('in_progress').optional().isBoolean(),
|
body('in_progress').optional({ values: 'null' }).isBoolean(),
|
||||||
body('due_date').optional().isISO8601().nullable()
|
body('due_date').optional({ values: 'null' }).isISO8601()
|
||||||
],
|
],
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in new issue
Block a user