UI Action Handler Changes, Misc Fixes

This commit is contained in:
Qstick 2017-11-26 15:09:45 -05:00
parent 7825319d89
commit cd5b658196
193 changed files with 6992 additions and 6341 deletions

View file

@ -2,33 +2,31 @@ import $ from 'jquery';
import { set } from '../baseActions';
function createFetchSchemaHandler(section, url) {
return function(payload) {
return function(dispatch, getState) {
dispatch(set({ section, isFetchingSchema: true }));
return function(getState, payload, dispatch) {
dispatch(set({ section, isFetchingSchema: true }));
const promise = $.ajax({
url
});
const promise = $.ajax({
url
});
promise.done((data) => {
dispatch(set({
section,
isFetchingSchema: false,
schemaPopulated: true,
schemaError: null,
schema: data
}));
});
promise.done((data) => {
dispatch(set({
section,
isFetchingSchema: false,
schemaPopulated: true,
schemaError: null,
schema: data
}));
});
promise.fail((xhr) => {
dispatch(set({
section,
isFetchingSchema: false,
schemaPopulated: true,
schemaError: xhr
}));
});
};
promise.fail((xhr) => {
dispatch(set({
section,
isFetchingSchema: false,
schemaPopulated: true,
schemaError: xhr
}));
});
};
}