1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-28 10:37:41 +00:00
Lidarr/UI/Commands/CommandController.js
2013-09-11 17:42:53 -07:00

21 lines
562 B
JavaScript

'use strict';
define(
[
'Commands/CommandModel',
'Commands/CommandCollection',
'underscore'
], function (CommandModel, CommandCollection, _) {
return{
Execute: function (name, properties) {
var attr = _.extend({name: name.toLocaleLowerCase()}, properties);
var commandModel = new CommandModel(attr);
return commandModel.save().success(function () {
CommandCollection.add(commandModel);
});
}
}
});