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

17
routes/methods/delete.js Normal file
View File

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