Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
61 lines
2 KiB
TypeScript
61 lines
2 KiB
TypeScript
// Module ID: 15122
|
|
// Function ID: 15123
|
|
// Name: ConsentActionCreators
|
|
// Dependencies: [1078, 577, 1119, 1275, 2]
|
|
// Exports: fetchConsents, setConsents
|
|
|
|
// Module 15122 (ConsentActionCreators)
|
|
import DispatcherDefault from "Dispatcher" /* 577 */;
|
|
import Constants from "Constants" /* 1078 */;
|
|
import util from "util" /* 1119 */;
|
|
import HTTPUtils from "HTTPUtils" /* 1275 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
function handleRequestSuccess(body) {
|
|
if (tmp) {
|
|
const obj2 = { type: "UPDATE_CONSENTS", consents: null };
|
|
const obj3 = {};
|
|
const merged = Object.assign(body.body);
|
|
obj2.consents = obj3;
|
|
DispatcherDefault.dispatch(obj2);
|
|
}
|
|
return body.body;
|
|
}
|
|
function handleRequestFailure(status) {
|
|
if (status.status >= 500) {
|
|
if (status.status <= 599) {
|
|
const intl2 = util.intl;
|
|
let message = intl2.string(util.t.cvJdtg);
|
|
}
|
|
const _Error = Error;
|
|
const error = new Error(message);
|
|
throw error;
|
|
}
|
|
if (null != status) {
|
|
if (null != status.body) {
|
|
if (null != status.body.message) {
|
|
message = status.body.message;
|
|
}
|
|
}
|
|
}
|
|
const intl = util.intl;
|
|
message = intl.string(util.t.cvJdtg);
|
|
}
|
|
const Endpoints = Constants.Endpoints;
|
|
const result = size.fileFinishedImporting("actions/ConsentActionCreators.tsx");
|
|
|
|
export const fetchConsents = function fetchConsents() {
|
|
const HTTP = HTTPUtils.HTTP;
|
|
const obj = { url: Endpoints.SETTINGS_CONSENT, oldFormErrors: true, rejectWithError: HTTPUtils.rejectWithMigratedError() };
|
|
value = HTTP.get(obj);
|
|
return value.then(handleRequestSuccess, (body) => {
|
|
const error = new Error(body.body.message);
|
|
return Promise.reject(error);
|
|
});
|
|
};
|
|
export const setConsents = function setConsents(items, items2) {
|
|
const HTTP = HTTPUtils.HTTP;
|
|
const request = { url: Endpoints.SETTINGS_CONSENT, body: { grant: items, revoke: items2 }, oldFormErrors: true, rejectWithError: HTTPUtils.rejectWithMigratedError() };
|
|
const obj = { grant: items, revoke: items2 };
|
|
return HTTP.post(request).then(handleRequestSuccess, handleRequestFailure);
|
|
};
|