import { createAsyncThunk } from "@reduxjs/toolkit";
import axios from "axios";
import { LOADING_END, LOADING_START } from "../../../lib/redux/slices/appSlice";

export const cityGetTicketDiffrentClearanceCode = createAsyncThunk(
  "CITY_GET_TICKET_DIFFRENT_CLEARANCE_CODE",
  async ({ licence_number, mobile }, { dispatch }) => {
    dispatch(LOADING_START());
    try {
      const { data, status } = await axios.get(
        `ticket_different_clearance_code_from_rsi/`,
        {
          params: { licence_number, mobile },
        }
      );
      dispatch(LOADING_END());
      return { data, status };
    } catch (error) {
      dispatch(LOADING_END());
    }
  }
);
