|
@@ -4,11 +4,7 @@ import {
|
|
createAction,
|
|
createAction,
|
|
PayloadAction,
|
|
PayloadAction,
|
|
} from '@reduxjs/toolkit';
|
|
} from '@reduxjs/toolkit';
|
|
-import {
|
|
|
|
- fetchPatientTypes,
|
|
|
|
- PatientType,
|
|
|
|
- PatientTypeParams,
|
|
|
|
-} from '../API/patientType';
|
|
|
|
|
|
+import { fetchPatientTypes, PatientType } from '../API/patientType';
|
|
import { AxiosError } from 'axios';
|
|
import { AxiosError } from 'axios';
|
|
|
|
|
|
interface PatientTypeState {
|
|
interface PatientTypeState {
|
|
@@ -35,14 +31,10 @@ export const patientTypeChanged = createAction<PatientType | null>(
|
|
|
|
|
|
export const getPatientTypes = createAsyncThunk(
|
|
export const getPatientTypes = createAsyncThunk(
|
|
'patientType/getPatientTypes',
|
|
'patientType/getPatientTypes',
|
|
- async (
|
|
|
|
- { params, token }: { params: PatientTypeParams; token: string },
|
|
|
|
- { rejectWithValue }
|
|
|
|
- ) => {
|
|
|
|
|
|
+ async (_, { rejectWithValue }) => {
|
|
try {
|
|
try {
|
|
console.log('Fetching patient types with params:');
|
|
console.log('Fetching patient types with params:');
|
|
-
|
|
|
|
- const data = await fetchPatientTypes(params, token);
|
|
|
|
|
|
+ const data = await fetchPatientTypes();
|
|
return data;
|
|
return data;
|
|
} catch (err: unknown) {
|
|
} catch (err: unknown) {
|
|
let errorMessage = 'Failed to fetch patient types';
|
|
let errorMessage = 'Failed to fetch patient types';
|