diff --git a/src/controllers/noteController.js b/src/controllers/noteController.js index abbcfd4..0b2f59a 100644 --- a/src/controllers/noteController.js +++ b/src/controllers/noteController.js @@ -70,15 +70,15 @@ const notesController = { return } - if (!newNote.title) { - apiBadRequestError(res, 'title is a required field in the body') - return - } - - if (!newNote.body) { - apiBadRequestError(res, 'body is a required field in the body') - return - } + // if (!newNote.title) { + // apiBadRequestError(res, 'title is a required field in the body') + // return + // } + + // if (!newNote.body) { + // apiBadRequestError(res, 'body is a required field in the body') + // return + // } const createdItem = await noteModel.createNote(userId, newNote) res.json(createdItem) diff --git a/src/utils/apiUtils.js b/src/utils/apiUtils.js index 4ee7fd0..fb5d254 100644 --- a/src/utils/apiUtils.js +++ b/src/utils/apiUtils.js @@ -10,6 +10,7 @@ export function apiBadRequestError(res, errorMessage) { export function apiForbiddenError(res, errorMessage) { res.status(403).send(errorMessage) + console.error(errorMessage) } /** @@ -20,6 +21,7 @@ export function apiForbiddenError(res, errorMessage) { */ export function apiNotFoundError(res, errorMessage) { res.status(404).send(errorMessage) + console.error(errorMessage) } /**