diff --git a/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx b/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx index 4a183e6d3..96623e1f8 100644 --- a/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx +++ b/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx @@ -122,7 +122,6 @@ export function LicenseQueuePage() { const activeView = SAVED_VIEWS.find((v) => v.id === view) ?? SAVED_VIEWS[0]; const { data: licenseTypes } = useGetLicenseTypesQuery(); - const { data: counts } = useGetQueueCountsQuery(); // A `/licence-review/type/:typeCode` deep link pins the type facet. const pinnedTypeId = useMemo(() => { @@ -151,6 +150,12 @@ export function LicenseQueuePage() { [activeView, urlFilter, debouncedSearch, pinnedTypeId, page], ); + // Tab badges scoped to the same license-type facet as the grid, so + // "Unassigned"/"Mine"/"All" counts match what's actually filtered in. + const { data: counts } = useGetQueueCountsQuery({ + licenseTypeId: filter.licenseTypeId, + }); + // One query per source; the two inactive ones are skipped, so switching // views costs a single request rather than keeping three in flight. const queueQuery = useGetQueueQuery(filter, { diff --git a/libs/api/src/lib/features/licensing/licensing-api.ts b/libs/api/src/lib/features/licensing/licensing-api.ts index 07e2a4c54..79c1a4d7f 100644 --- a/libs/api/src/lib/features/licensing/licensing-api.ts +++ b/libs/api/src/lib/features/licensing/licensing-api.ts @@ -417,8 +417,11 @@ export const licensingApi = baseApi * claim or a decision refreshes the badges along with the list and the * numbers can never drift from what the grid is showing. */ - getQueueCounts: builder.query({ - query: () => ({ url: '/license-application-review/counts' }), + getQueueCounts: builder.query({ + query: (params) => ({ + url: '/license-application-review/counts', + params: serialiseQueueFilter(params), + }), providesTags: () => [listTag('ApplicationQueue')], }),