Fixed Leave rejection and approvals
This commit is contained in:
@@ -127,12 +127,17 @@ final swapRequestsProvider = StreamProvider<List<SwapRequest>>((ref) {
|
||||
|
||||
ref.onDispose(wrapper.dispose);
|
||||
return wrapper.stream.map((result) {
|
||||
return result.data
|
||||
.where(
|
||||
(row) =>
|
||||
row.requesterId == profile.id || row.recipientId == profile.id,
|
||||
)
|
||||
.toList();
|
||||
// only return requests that are still actionable; once a swap has been
|
||||
// accepted or rejected we no longer need to bubble it up to the UI for
|
||||
// either party. admins still see "admin_review" rows so they can act on
|
||||
// escalated cases.
|
||||
return result.data.where((row) {
|
||||
if (!(row.requesterId == profile.id || row.recipientId == profile.id)) {
|
||||
return false;
|
||||
}
|
||||
// only keep pending and admin_review statuses
|
||||
return row.status == 'pending' || row.status == 'admin_review';
|
||||
}).toList();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user