2026-07-16 18:26:01 +05:30

15 lines
508 B
TypeScript

import { createAsyncThunk } from '@reduxjs/toolkit';
import { getLeadDetailsApi } from '@api';
import { LeadDetailsItem } from '@interfaces';
export const getLeadDetails = createAsyncThunk<
LeadDetailsItem,
{ leadId: string; staffid: string }
>('leadDetails/getLeadDetails', async (payload, { rejectWithValue }) => {
try {
return await getLeadDetailsApi(payload.leadId, payload.staffid);
} catch (error: any) {
return rejectWithValue(error.message || 'Failed to load lead details');
}
});