%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/emergentqj/actioncivile/pre-auth/.f81b4c9eb38fd76cdf20462cf2027aa3/static/js/actions/
Upload File :
Create Path :
Current File : /home/emergentqj/actioncivile/pre-auth/.f81b4c9eb38fd76cdf20462cf2027aa3/static/js/actions/list_actions.js

import LIST_ACTIONS from "../constants/action_types";
import { getCountryFromCookie, getRealmFromCookie } from "../utils/countries";
import { getLanguageFromCookie } from "../utils/languages";

const urlParams = new URLSearchParams(window.location.search);
const country = urlParams.get("country") || getCountryFromCookie();
const realm = urlParams.get("realm") || getRealmFromCookie();
const language = urlParams.get("lang") || getLanguageFromCookie();

export const showAlert = (params) => ({
  type: LIST_ACTIONS.SHOW_ALERT,
  payload: params,
});

// will replace showAlert above SOON™
export const showAlertModal = (params) => ({
  type: LIST_ACTIONS.SHOW_ALERT_MODAL,
  payload: params,
});

export const hideAlert = () => ({
  type: LIST_ACTIONS.HIDE_ALERT,
});

export const hideAlertModal = () => ({
  type: LIST_ACTIONS.HIDE_ALERT_MODAL,
});

export const resetRestorePswSession = () => ({
  type: LIST_ACTIONS.RESET_RESTORE_PSW_SESSION,
});

export const checkToken = (token) => ({
  type: LIST_ACTIONS.CHECK_PASSWORD_RESET_TOKEN,
  data: {
    token,
    country,
    realm,
    language,
  },
});

export function resetPassword(phone, token, newPassword) {
  return {
    type: LIST_ACTIONS.RESET_PASSWORD_REQUEST,
    data: {
      username: phone,
      pincode: token,
      newpassword: newPassword,
      country,
      realm,
      language,
    },
  };
}

export function resetPasswordToken(token, newPassword) {
  return {
    type: LIST_ACTIONS.RESET_PASSWORD_TOKEN_REQUEST,
    data: {
      fullToken: token,
      newPassword,
      country,
      realm,
      language,
    },
  };
}

export const resetPasswordWithToken = (token) => ({
  type: LIST_ACTIONS.RESET_PASSWORD_WITH_TOKEN,
  payload: token,
  country,
  realm,
  language,
});

export function cancelPhoneSendConfirm() {
  return {
    type: LIST_ACTIONS.CANCEL_PHONE_SENT_CONFIRM,
  };
}

export const resetValidationErrors = () => ({ type: LIST_ACTIONS.RESET_VALIDATION_ERRORS });

export function sendOtpToken(data) {
  return {
    type: LIST_ACTIONS.SEND_OTP_TOKEN_REQUEST,
    data,
  };
}

export function sendLicensePlate(data) {
  return {
    type: LIST_ACTIONS.SEND_LICENSE_PLATE_REQUEST,
    data,
  };
}

export function selectCode(data) {
  return {
    type: LIST_ACTIONS.SELECT_CODE,
    data,
  };
}

export function getOtpToken(data, resent = null) {
  return {
    type: LIST_ACTIONS.GET_OTP_TOKEN_REQUEST,
    data,
    resent,
  };
}

export function scramblePhone(data) {
  return {
    type: LIST_ACTIONS.SCRAMBLE_PHONE,
    data,
  };
}

export function setLanguageData(data) {
  return {
    type: LIST_ACTIONS.SET_LANGUAGE,
    data,
  };
}

export function setEnvConstant(model) {
  return {
    type: LIST_ACTIONS.SET_ENV_CONSTANTS,
    model,
  };
}

export const getProductPackageInfo = (ids) => ({
  type: LIST_ACTIONS.GET_PRODUCT_PACKAGE_INFO_REQUEST,
  ids,
});

export const setBusinessIframeSuccess = (payload) => ({
  type: LIST_ACTIONS.SET_BUSINESS_IFRAME_SUCCESS,
  payload,
});

export const setBusinessIframeError = (payload) => ({
  type: LIST_ACTIONS.SET_BUSINESS_IFRAME_ERROR,
  payload,
});

export const languageManuallySet = () => ({
  type: LIST_ACTIONS.SET_LANGUAGE_MANUALLY_SET,
  payload: true,
});

export const clearUnauthorized = () => ({
  type: LIST_ACTIONS.USER_AUTH_UNAUTHORIZED,
  payload: {
    unauthorized: false,
    unauthorizedReason: "",
  },
});

export function setDualEnv(payload) {
  return {
    type: LIST_ACTIONS.SET_IS_DUAL_ENV,
    payload,
  };
}

export const setRecoveryType = (val) => ({
  type: LIST_ACTIONS.SET_RECOVERY_TYPE,
  payload: val,
});

Zerion Mini Shell 1.0