Fixed Leave rejection and approvals

This commit is contained in:
2026-03-11 18:59:28 +08:00
parent 21e6d68910
commit f8c79acbbc
4 changed files with 41 additions and 9 deletions
+11 -6
View File
@@ -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();
});
});