Licence applications filter

This commit is contained in:
estifanos
2026-08-10 10:10:34 +00:00
parent c822e99052
commit 73de3f212b
2 changed files with 11 additions and 3 deletions

View File

@@ -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, {

View File

@@ -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<QueueCounts, void>({
query: () => ({ url: '/license-application-review/counts' }),
getQueueCounts: builder.query<QueueCounts, QueueFilter | void>({
query: (params) => ({
url: '/license-application-review/counts',
params: serialiseQueueFilter(params),
}),
providesTags: () => [listTag('ApplicationQueue')],
}),