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()) } }