handled attendance error object in readble format
This commit is contained in:
parent
ea0c3b5ca7
commit
26c1492300
@ -38,8 +38,10 @@ export const markAttendance = createAsyncThunk(
|
|||||||
|
|
||||||
const response = await AttendanceRepository.markAttendance( newRecordAttendance );
|
const response = await AttendanceRepository.markAttendance( newRecordAttendance );
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch ( error )
|
||||||
return thunkAPI.rejectWithValue(error.message);
|
{
|
||||||
|
const message = error?.response?.data?.message || error.message || "Error Occured During Api Call";
|
||||||
|
return thunkAPI.rejectWithValue(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user