handled attendance error object in readble format
This commit is contained in:
parent
349d2a62ff
commit
3a84d2f4c9
@ -38,8 +38,10 @@ export const markAttendance = createAsyncThunk(
|
||||
|
||||
const response = await AttendanceRepository.markAttendance( newRecordAttendance );
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
return thunkAPI.rejectWithValue(error.message);
|
||||
} catch ( error )
|
||||
{
|
||||
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