DONE
This commit is contained in:
17
routes/methods/delete.js
Normal file
17
routes/methods/delete.js
Normal 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())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user