projectController.js 279 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 const { Project } = require('../../models'); exports.list = async (req, res, next) => { try { const { id: userId } = req.user; const projects = await Project.findAll({ where: { userId } }); res.json({ ok: true, projects }); } catch (err) { next(err); } };