endpoints/endpoints

View on GitHub
es5/store-bookshelf/lib/destroy.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * Deletes a model.
 *
 * @param {Bookshelf.Model} model
 * @return {Promise.Bookshelf.Model} The deleted model.
 */
'use strict';

exports.__esModule = true;
exports['default'] = destroy;

function destroy(model) {
  if (!model) {
    throw new Error('No model provided.');
  }
  return model.destroy();
}

module.exports = exports['default'];