四好公路
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

28 lines
600 B

'use strict';
var util = require('util'),
Base = require('./base'),
ReadController = require('./read');
var Delete = function(args) {
Delete.super_.call(this, args);
};
util.inherits(Delete, Base);
Delete.prototype.action = 'delete';
Delete.prototype.method = 'delete';
Delete.prototype.plurality = 'singular';
Delete.prototype.fetch = ReadController.prototype.fetch;
Delete.prototype.write = function(req, res, context) {
return context.instance
.destroy()
.then(function() {
context.instance = {};
return context.continue;
});
};
module.exports = Delete;