22 lines
343 B
JavaScript
22 lines
343 B
JavaScript
const _ = require('lodash');
|
|
|
|
module.exports = {
|
|
raw
|
|
};
|
|
|
|
function raw(req, res, next) {
|
|
if (!_.isFunction(res.transform)) {
|
|
res.transform = transform;
|
|
}
|
|
|
|
next();
|
|
|
|
function transform(data) {
|
|
const resp = {
|
|
tipoMensaje: 'EXITO',
|
|
mensaje: 'Procesamiento exitoso',
|
|
datos: data || {}
|
|
}
|
|
return resp;
|
|
}
|
|
} |