import { createAsyncThunk } from '@reduxjs/toolkit';
import { axiosCommonInstance, axiosInstance } from '../../utils/axiosInstances';

export const getUserData = createAsyncThunk('userSlice/getEmpAccess', async (data) => {
    const { UserId } = data;
    if (UserId) {
        return await axiosInstance.get(`/User?UserId=${data?.UserId}`);
    }
});

export const getSessionDataFromCommon = createAsyncThunk(
    'userSlice/getSessionDataFromCommon',
    async (postData) => {
        return await axiosCommonInstance.get(
            `/URLshortener?referenceNo=${postData}`
        );
    }
);