1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-29 02:55:38 +00:00
Lidarr/UI/Commands/CommandController.js

22 lines
562 B
JavaScript
Raw Normal View History

2013-06-22 06:24:24 +00:00
'use strict';
2013-09-11 06:33:47 +00:00
define(
[
'Commands/CommandModel',
'Commands/CommandCollection',
'underscore'
], function (CommandModel, CommandCollection, _) {
2013-05-11 23:39:32 +00:00
2013-09-11 06:33:47 +00:00
return{
Execute: function (name, properties) {
var attr = _.extend({name: name.toLocaleLowerCase()}, properties);
2013-06-13 02:55:11 +00:00
2013-09-11 06:33:47 +00:00
var commandModel = new CommandModel(attr);
return commandModel.save().success(function () {
CommandCollection.add(commandModel);
});
}
2013-06-13 02:55:11 +00:00
}
});