handled attendance error object in readble format

This commit is contained in:
Pramod Mahajan 2025-05-10 12:32:26 +05:30
parent 349d2a62ff
commit 3a84d2f4c9

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