diff --git a/repositories/data.json b/repositories/data.json index 68e5d5b..b4508a6 100644 --- a/repositories/data.json +++ b/repositories/data.json @@ -89,6 +89,15 @@ "created_at": "2021-09-15T10:43:02.014Z", "updated_at": "2021-08-07T07:06:51.050Z" }, + { + "id": 11, + "title": "Mangshan pitviper", + "category": "task", + "archive": false, + "content": "Try to synthesize the FTP microchip, maybe it will hack the bluetooth microchip!", + "created_at": "2021-09-10T15:30:21.732Z", + "updated_at": null + }, { "id": 12, "title": "Indian python", @@ -268,5 +277,14 @@ "content": "If we hack the bus, we can get to the TCP capacitor through the 1080p CSS transmitter!", "created_at": "2021-08-17T12:04:24.277Z", "updated_at": null + }, + { + "id": 32, + "title": "Cat snake", + "category": "task", + "archive": false, + "content": "bypassing the system won't do anything, we need to quantify the open-source RAM matrix!", + "created_at": "2021-10-14T13:03:11.921Z", + "updated_at": null } ] \ No newline at end of file diff --git a/routes/router.js b/routes/router.js index ee92295..edaf3ee 100644 --- a/routes/router.js +++ b/routes/router.js @@ -3,7 +3,7 @@ import { addNote } from './methods/post.js' import { notesIndex, getSingleNote, getStats } from './methods/get.js' import { editNote } from './methods/patch.js' import { deleteNote } from './methods/delete.js' -import { id as validate } from '../services/ValidationService.js' +import validate from '../services/ValidationService.js' import { idOnlySchema, newNoteSchema, updateNoteSchema } from '../repositories/schema.js' import { setResp403 } from '../helpers/http.js' diff --git a/services/ValidationService.js b/services/ValidationService.js index 6dec0d9..d08544b 100644 --- a/services/ValidationService.js +++ b/services/ValidationService.js @@ -7,7 +7,7 @@ import {webFields} from '../repositories/schema.js' * @param schema * @returns {(function(*, *, *): Promise<*|undefined>)|*} */ -export const id = (schema) => async (req, res, next) => { +export default (schema) => async (req, res, next) => { let objToValidate