fix(mobile): resolve client crash and shift status inconsistency
This commit is contained in:
@@ -186,10 +186,20 @@ class ShiftsRepositoryImpl
|
||||
final fdc.QueryResult<dc.ListShiftRolesByVendorIdData, dc.ListShiftRolesByVendorIdVariables> result = await _service.executeProtected(() => _service.connector
|
||||
.listShiftRolesByVendorId(vendorId: vendorId)
|
||||
.execute());
|
||||
|
||||
|
||||
|
||||
final allShiftRoles = result.data.shiftRoles;
|
||||
|
||||
// Fetch my applications to filter out already booked shifts
|
||||
final List<Shift> myShifts = await _fetchApplications();
|
||||
final Set<String> myShiftIds = myShifts.map((s) => s.id).toSet();
|
||||
|
||||
final List<Shift> mappedShifts = [];
|
||||
for (final sr in allShiftRoles) {
|
||||
// Skip if I have already applied/booked this shift
|
||||
if (myShiftIds.contains(sr.shiftId)) continue;
|
||||
|
||||
|
||||
final DateTime? shiftDate = _service.toDateTime(sr.shift.date);
|
||||
final startDt = _service.toDateTime(sr.startTime);
|
||||
|
||||
Reference in New Issue
Block a user