UNPKG

@conceptho/adonis-service-layer

Version:
27 lines (22 loc) 546 B
const VanillaSerializer = require('@adonisjs/lucid/src/Lucid/Serializers/Vanilla') class DefaultSerializer extends VanillaSerializer { /** * Returns the json object for a given model instance * * @method _getRowJSON * * @param {Model} modelInstance * * @return {Object} * * @private */ _getRowJSON (modelInstance) { const json = super._getRowJSON(modelInstance) // Delete meta & pivot fields delete json.__meta__ delete json.pivot return json } } module.exports = DefaultSerializer