55 lines
3.1 KiB
TypeScript
55 lines
3.1 KiB
TypeScript
/* Metro module 13378; source: actions/ConsentActionCreators.tsx; dependencies: [661, 694, 1244, 507, 2] */
|
|
function _fun101869(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13568:6, offset: 0x0222242a, size: 159 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = (require(661) /* metro dependency 661: Constants */).Endpoints;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('actions/ConsentActionCreators.tsx');
|
|
exports.fetchConsents = function() {
|
|
var HTTP = require(dependencyMap[3]).HTTP;
|
|
return HTTP.get({'url': null, 'oldFormErrors': true, 'rejectWithError': false,
|
|
url: Endpoints.SETTINGS_CONSENT}).then(handleRequestSuccess, _fun101873);
|
|
};
|
|
exports.setConsents = function(a0, a1) {
|
|
var HTTP = require(dependencyMap[3]).HTTP;
|
|
return HTTP.post({url: Endpoints.SETTINGS_CONSENT, body: {grant: a0, revoke: a1}, oldFormErrors: true,
|
|
rejectWithError: false}).then(handleRequestSuccess, handleRequestFailure);
|
|
};
|
|
}
|
|
|
|
function handleRequestSuccess(a0) { // fn#101870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13568:116, offset: 0x022224c9, size: 97 bytes, params: 2, frame: 15
|
|
var dispatch;
|
|
var object;
|
|
let value = a0 != null;
|
|
if (value && a0.body != null) {
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
dispatch = value.dispatch;
|
|
object = {};
|
|
copyDataProperties(object, a0.body, undefined);
|
|
Reflect.apply(dispatch, value, [{type: 'UPDATE_CONSENTS', consents: object}]);
|
|
}
|
|
return a0.body;
|
|
}
|
|
|
|
function handleRequestFailure(a0) { // fn#101871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13568:250, offset: 0x0222252a, size: 229 bytes, params: 2, frame: 15
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const r2 = a0.status >= 500 && a0.status <= 599 || (a0 == null || a0.body == null) ? intl.string(t.cvJdtg) : a0.body.message ?? intl.string(t.cvJdtg);
|
|
const Error = global.Error;
|
|
throw new Error();
|
|
}
|
|
|
|
function fetchConsents() { // fn#101872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13568:557, offset: 0x0222260f, size: 92 bytes, params: 1, frame: 14
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const get = HTTP.get;
|
|
const SETTINGS_CONSENT = Endpoints.SETTINGS_CONSENT;
|
|
const value2 = Reflect.apply(get, HTTP, [{'url': null, 'oldFormErrors': true, 'rejectWithError': false,
|
|
url: SETTINGS_CONSENT}]);
|
|
return value2.then(handleRequestSuccess, function(a0) {
|
|
var Promise = global.Promise;
|
|
var Error = global.Error;
|
|
return Promise.reject(new Error(a0.body.message));
|
|
});
|
|
}
|
|
|