fix(sidebar): gate outbox+webhook badge polls on INTERNAL scope (no more 403 spam)
This commit is contained in:
@@ -372,7 +372,13 @@ export const outboxStatsQuery = queryOptions({
|
||||
refetchInterval: 30_000,
|
||||
})
|
||||
|
||||
export const useOutboxStats = () => useQuery(outboxStatsQuery)
|
||||
/**
|
||||
* Outbox stats poll. Backend gate INTERNAL scope — пользователь без
|
||||
* нужной роли получает 403. Передавай {@code enabled=false} для
|
||||
* unauthenticated/non-INTERNAL users чтобы не спамить console 403'ами.
|
||||
*/
|
||||
export const useOutboxStats = (enabled = true) =>
|
||||
useQuery({ ...outboxStatsQuery, enabled })
|
||||
|
||||
export const dlqQuery = (page: number, size: number) =>
|
||||
queryOptions({
|
||||
@@ -399,7 +405,14 @@ export const webhookSubscriptionsQuery = queryOptions({
|
||||
},
|
||||
})
|
||||
|
||||
export const useWebhookSubscriptions = () => useQuery(webhookSubscriptionsQuery)
|
||||
/**
|
||||
* Webhook subscriptions list. INTERNAL-scoped (admin/webhooks/...). Same
|
||||
* pattern as {@link useOutboxStats} — pass {@code enabled=false} для
|
||||
* pollers (Sidebar badge) когда user не имеет INTERNAL scope, чтобы
|
||||
* избежать 403 spam.
|
||||
*/
|
||||
export const useWebhookSubscriptions = (enabled = true) =>
|
||||
useQuery({ ...webhookSubscriptionsQuery, enabled })
|
||||
|
||||
export const webhookSubscriptionQuery = (id: string) =>
|
||||
queryOptions({
|
||||
|
||||
Reference in New Issue
Block a user