fix(ui): workflow library infinite query providesTags

This commit is contained in:
psychedelicious
2025-03-11 19:25:46 +10:00
parent 4feff5a185
commit ef95b37ace

View File

@@ -99,7 +99,12 @@ export const workflowsApi = api.injectEndpoints({
providesTags: (result) => {
const tags: ApiTagDescription[] = ['FetchOnReconnect', { type: 'Workflow', id: LIST_TAG }];
if (result) {
tags.push(...result.items.map((workflow) => ({ type: 'Workflow', id: workflow.workflow_id }) as const));
tags.push(
...result.pages
.map(({ items }) => items)
.flat()
.map((workflow) => ({ type: 'Workflow', id: workflow.workflow_id }) as const)
);
}
return tags;
},