codecombat/app/models/Patch.coffee

15 lines
417 B
CoffeeScript
Raw Normal View History

2014-06-30 22:16:26 -04:00
CocoModel = require './CocoModel'
module.exports = class PatchModel extends CocoModel
2014-06-30 22:16:26 -04:00
@className: 'Patch'
@schema: require 'schemas/models/patch'
2014-06-30 22:16:26 -04:00
urlRoot: '/db/patch'
setStatus: (status, options={}) ->
options.url = "/db/patch/#{@id}/status"
options.type = 'PUT'
@save({status}, options)
2014-04-16 13:42:32 -04:00
@setStatus: (id, status) ->
2014-06-30 22:16:26 -04:00
$.ajax("/db/patch/#{id}/status", {type: 'PUT', data: {status: status}})