DONE
This commit is contained in:
18
routes/methods/patch.js
Normal file
18
routes/methods/patch.js
Normal 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 editNote = async (req, res) => {
|
||||
|
||||
try{
|
||||
const data = await db.updateNote(req.validatedData)
|
||||
res.status(data.code || 200).json(data)
|
||||
}catch (e) {
|
||||
res.status(500).json(setResp500())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user