Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
42 lines
2.3 KiB
TypeScript
42 lines
2.3 KiB
TypeScript
// Module ID: 16031
|
|
// Function ID: 16032
|
|
// Name: AgeGateActionCreators
|
|
// Dependencies: [1098, 1074, 16030, 1242, 1272, 573, 2]
|
|
// Exports: logoutUnderageNewUser, preventUnderageRegistration, submitDateOfBirth
|
|
|
|
// Module 16031 (AgeGateActionCreators)
|
|
import DispatcherDefault from "Dispatcher" /* 573 */;
|
|
import AgeGateConstants from "AgeGateConstants" /* 1098 */;
|
|
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1242 */;
|
|
import trackAgeGateSubmittedDefault from "trackAgeGateSubmitted" /* 16030 */;
|
|
import Constants from "Constants" /* 1074 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
const AgeGateAnalyticAction = AgeGateConstants.AgeGateAnalyticAction;
|
|
({ AnalyticEvents: closure_4, Endpoints: hasOwnProperty } = Constants);
|
|
const result = size.fileFinishedImporting("modules/age_gate/AgeGateActionCreators.tsx");
|
|
|
|
export const submitDateOfBirth = function submitDateOfBirth(format, source) {
|
|
_require = source;
|
|
trackAgeGateSubmittedDefault(format, source);
|
|
AnalyticsUtilsDefault.track(constants.AGE_GATE_ACTION, { source, action: AgeGateAnalyticAction.AGE_GATE_SUBMITTED });
|
|
const HTTP = require("HTTPUtils").HTTP;
|
|
const request = { url: constants2.ME, oldFormErrors: true, body: null, rejectWithError: false };
|
|
const obj2 = { source, action: AgeGateAnalyticAction.AGE_GATE_SUBMITTED };
|
|
request.body = { date_of_birth: format.format("YYYY-MM-DD") };
|
|
const obj3 = { date_of_birth: format.format("YYYY-MM-DD") };
|
|
return HTTP.patch(request).then((user) => {
|
|
DispatcherDefault.dispatch({ type: "CURRENT_USER_UPDATE", user: user.body });
|
|
AnalyticsUtilsDefault.track(constants.AGE_GATE_ACTION, { source, action: AgeGateAnalyticAction.AGE_GATE_SUCCESS });
|
|
});
|
|
};
|
|
export const preventUnderageRegistration = function preventUnderageRegistration(REGISTER) {
|
|
DispatcherDefault.dispatch({ type: "AGE_GATE_PREVENT_UNDERAGE_REGISTRATION" });
|
|
AnalyticsUtilsDefault.track(constants.AGE_GATE_ACTION, { source: REGISTER, action: AgeGateAnalyticAction.AGE_GATE_PREVENT_UNDERAGE_REGISTRATION });
|
|
};
|
|
export const logoutUnderageNewUser = function logoutUnderageNewUser(source) {
|
|
DispatcherDefault.dispatch({ type: "AGE_GATE_LOGOUT_UNDERAGE_NEW_USER" });
|
|
AnalyticsUtilsDefault.track(constants.AGE_GATE_ACTION, { source, action: AgeGateAnalyticAction.AGE_GATE_LOGOUT_UNDERAGE_NEW_USER });
|
|
};
|