This commit is contained in:
2021-10-15 02:00:40 +03:00
parent 74316481f1
commit ade92e0493
15 changed files with 884 additions and 0 deletions

18
routes/methods/post.js Normal file
View File

@@ -0,0 +1,18 @@
import { setResp500 } from '../../helpers/http.js'
import NotesService from '../../services/NotesService.js'
/**
*
* @type {NotesService}
*/
const db = new NotesService()
export const addNote = async (req, res) => {
try{
const data = await db.insertNote(req.validatedData)
res.status(data.code || 200).json(data)
}catch (e) {
res.status(500).json(setResp500())
}
}