node.js 557 B

1234567891011121314151617181920212223
  1. var AppState = require('../app_state');
  2. var Backbone = require('backbone');
  3. var Node = Backbone.Model.extend({ //eslint-disable-line no-undef
  4. idAttribute: 'name',
  5. constructor: function Node() {
  6. Backbone.Model.prototype.constructor.apply(this, arguments);
  7. },
  8. urlRoot: function() {
  9. return AppState.apiPath('/nodes');
  10. },
  11. tombstoneTopic: function(topic) {
  12. return this.destroy({
  13. 'data': JSON.stringify({'topic': topic}),
  14. 'dataType': 'text'
  15. });
  16. }
  17. });
  18. module.exports = Node;