17 lines
478 B
TypeScript
17 lines
478 B
TypeScript
import { getDashboardApi } from '@api';
|
|
import { createAsyncThunk } from '@reduxjs/toolkit';
|
|
|
|
export const getDashboard = createAsyncThunk(
|
|
'onboardingComplete/getDashboard',
|
|
async (_, { rejectWithValue }) => {
|
|
try {
|
|
const response = await getDashboardApi();
|
|
return response;
|
|
} catch (error: unknown) {
|
|
const message =
|
|
error instanceof Error ? error.message : 'Failed to get dashboard';
|
|
return rejectWithValue(message);
|
|
}
|
|
},
|
|
);
|