- Cataloghi
- Import ed Export Pagine - ObjectID sostituita con ObjectId
This commit is contained in:
@@ -16,7 +16,7 @@ const Hours = require('../models/hours');
|
||||
|
||||
const _ = require('lodash');
|
||||
|
||||
const { ObjectID } = require('mongodb');
|
||||
const { ObjectId } = require('mongodb');
|
||||
|
||||
|
||||
router.post('/', authenticate, async (req, res) => {
|
||||
@@ -93,7 +93,7 @@ router.patch('/:id', authenticate, (req, res) => {
|
||||
|
||||
// tools.mylogshow('PATCH TODO: ', id);
|
||||
|
||||
if (!ObjectID.isValid(id)) {
|
||||
if (!ObjectId.isValid(id)) {
|
||||
tools.mylog('ERROR: id not VALID', id);
|
||||
return res.status(404).send();
|
||||
}
|
||||
@@ -160,7 +160,7 @@ router.get('/:userId', authenticate, (req, res) => {
|
||||
|
||||
// tools.mylog('GET TODOS : ', req.params);
|
||||
|
||||
if (!ObjectID.isValid(userId)) {
|
||||
if (!ObjectId.isValid(userId)) {
|
||||
return res.status(404).send();
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ router.get('/:userId', authenticate, (req, res) => {
|
||||
router.get('/test', (req, res) => {
|
||||
|
||||
const todo = {
|
||||
_id: new ObjectID(),
|
||||
_id: new ObjectId(),
|
||||
// category: "personal",
|
||||
statustodo: 0,
|
||||
completed_at: new Date(),
|
||||
@@ -239,7 +239,7 @@ router.delete('/:id', authenticate, (req, res) => {
|
||||
|
||||
let hide = true;
|
||||
|
||||
if (!ObjectID.isValid(id)) {
|
||||
if (!ObjectId.isValid(id)) {
|
||||
return res.status(404).send();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user