import configService from '../services/config.service.js'; import typesError from '../error/types.error.js'; const getConfig = async (request, reply) => { try { const config = await configService.getConfig() return reply.code(200).send({ config: config.toJson() }) } catch (e) { return reply.code(500).send({ message: e.message }) } } const updateConfig = async (request, reply) => { const newConfig = request.body try { await configService.updateConfig(newConfig) return reply.code(200).send({ success: true }) } catch (e) { return reply.code(500).send({ message: typesError.TECHNICAL_UNKNOWN }) } } export default { getConfig, updateConfig }