mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-28 13:01:28 +02:00
Added more magic to fancy. it now automatically figures our response for PUT and POST based on request ID.
file name sample uses HTTP GET instead of post
This commit is contained in:
@@ -19,13 +19,13 @@ define(
|
||||
'change .x-rename-episodes': '_setNamingOptionsVisibility'
|
||||
},
|
||||
|
||||
onRender: function(){
|
||||
if(!this.model.get('renameEpisodes')){
|
||||
onRender: function () {
|
||||
if (!this.model.get('renameEpisodes')) {
|
||||
this.ui.namingOptions.hide();
|
||||
}
|
||||
|
||||
this.listenTo(this.model, 'change', this._buildExamples);
|
||||
this._buildExamples();
|
||||
this.listenTo(this.model, 'change', this._updateExamples);
|
||||
this._updateExamples();
|
||||
},
|
||||
|
||||
_setNamingOptionsVisibility: function () {
|
||||
@@ -39,16 +39,14 @@ define(
|
||||
}
|
||||
},
|
||||
|
||||
_buildExamples: function () {
|
||||
_updateExamples: function () {
|
||||
|
||||
var self = this;
|
||||
|
||||
var data = this.model.toJSON();
|
||||
data.id = 0;
|
||||
|
||||
var promise = $.ajax({
|
||||
type: 'POST',
|
||||
url : window.ApiRoot + '/naming',
|
||||
data: JSON.stringify(data)
|
||||
type: 'GET',
|
||||
url : window.ApiRoot + '/config/naming/samples',
|
||||
data: this.model.toJSON()
|
||||
});
|
||||
|
||||
promise.done(function (result) {
|
||||
|
Reference in New Issue
Block a user