handled attendance error object in readble format

This commit is contained in:
Pramod Mahajan 2025-05-10 12:32:26 +05:30 committed by Vikas Nale
parent ea0c3b5ca7
commit 26c1492300

View File

@ -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);
}
}
);