Spaces:
Sleeping
Sleeping
| const partnerService = require('../services/partner.service'); | |
| exports.list = async (req, res, next) => { | |
| try { res.json({ applications: await partnerService.list({ ...req.query, marketFilter: req.marketFilter }) }); } | |
| catch (error) { next(error); } | |
| }; | |
| exports.getById = async (req, res, next) => { | |
| try { res.json({ application: await partnerService.getById(req.params.id) }); } | |
| catch (error) { next(error); } | |
| }; | |
| exports.updateStatus = async (req, res, next) => { | |
| try { | |
| const application = await partnerService.updateStatus(req.params.id, req.body, req.admin._id, req.ip); | |
| res.json({ application, message: `Application status updated to '${req.body.status}'.` }); | |
| } catch (error) { next(error); } | |
| }; | |