mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04: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:
@@ -1,4 +1,4 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Settings/SettingsModelBase'
|
||||
|
||||
@@ -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