PLT-11 Adding ability to save config file
Этот коммит содержится в:
@@ -345,6 +345,32 @@ export function getLogs() {
|
||||
);
|
||||
}
|
||||
|
||||
export function getConfig() {
|
||||
if (isCallInProgress('getConfig')) {
|
||||
return;
|
||||
}
|
||||
|
||||
callTracker.getConfig = utils.getTimestamp();
|
||||
client.getConfig(
|
||||
(data, textStatus, xhr) => {
|
||||
callTracker.getConfig = 0;
|
||||
|
||||
if (xhr.status === 304 || !data) {
|
||||
return;
|
||||
}
|
||||
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECIEVED_CONFIG,
|
||||
config: data
|
||||
});
|
||||
},
|
||||
(err) => {
|
||||
callTracker.getConfig = 0;
|
||||
dispatchError(err, 'getConfig');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function findTeams(email) {
|
||||
if (isCallInProgress('findTeams_' + email)) {
|
||||
return;
|
||||
|
||||
@@ -297,7 +297,7 @@ export function getLogs(success, error) {
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
type: 'GET',
|
||||
success: success,
|
||||
success,
|
||||
error: function onError(xhr, status, err) {
|
||||
var e = handleError('getLogs', xhr, status, err);
|
||||
error(e);
|
||||
@@ -305,6 +305,35 @@ export function getLogs(success, error) {
|
||||
});
|
||||
}
|
||||
|
||||
export function getConfig(success, error) {
|
||||
$.ajax({
|
||||
url: '/api/v1/admin/config',
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
type: 'GET',
|
||||
success,
|
||||
error: function onError(xhr, status, err) {
|
||||
var e = handleError('getConfig', xhr, status, err);
|
||||
error(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function saveConfig(config, success, error) {
|
||||
$.ajax({
|
||||
url: '/api/v1/admin/save_config',
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
type: 'POST',
|
||||
data: JSON.stringify(config),
|
||||
success,
|
||||
error: function onError(xhr, status, err) {
|
||||
var e = handleError('saveConfig', xhr, status, err);
|
||||
error(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function getMeSynchronous(success, error) {
|
||||
var currentUser = null;
|
||||
$.ajax({
|
||||
|
||||
Ссылка в новой задаче
Block a user