mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-22 04:46:40 +00:00
add pending approvals count to sidebar
This commit is contained in:
@@ -377,5 +377,17 @@ export const approvalQueries = {
|
||||
});
|
||||
return res.data.data;
|
||||
}
|
||||
}),
|
||||
pendingCount: (orgId: string) =>
|
||||
queryOptions({
|
||||
queryKey: ["APPROVALS", orgId, "COUNT", "pending"] as const,
|
||||
queryFn: async ({ signal, meta }) => {
|
||||
const res = await meta!.api.get<
|
||||
AxiosResponse<{ count: number }>
|
||||
>(`/org/${orgId}/approvals/count?approvalState=pending`, {
|
||||
signal
|
||||
});
|
||||
return res.data.data.count;
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user