Skip to content

Commit 0497756

Browse files
authored
Fix signup filtering by approval (#105)
On the request credit page, the filtering to only include non-approved requests was not effective, so we would query all signups. On top of that, we were also sorting data chronologically, so we were only getting the 50 oldest approvals. For folks with more than 50 signups, we would therefore not load the more recent office hours, and desk workers couldn't request credit for them.
1 parent 60b8500 commit 0497756

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/pages/OfficeHours/RequestDeskCreditPage/RequestDeskCreditForm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export function RequestDeskCreditForm({ onRequestSubmitted }: Props) {
3838
const { data, refetch } = useGetPersonSignupsQuery({
3939
personID: user!.id,
4040
approved: false,
41+
orderBy: "-date",
4142
});
4243
const today = dayjs().format("YYYY-MM-DD");
4344

src/redux/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export const gearDbApi = createApi({
138138
query: ({ personID, approved, page, orderBy }) => ({
139139
url: `/people/${personID}/office-hour-signups/`,
140140
params: {
141-
...(approved && { approved }),
141+
...(approved != null && { approved }),
142142
...(page != null && { page }),
143143
...(orderBy != null && { orderBy }),
144144
},

0 commit comments

Comments
 (0)