Optimize image API invalidation tags and simplify cache invalidation logic

Co-authored-by: kent <kent@invoke.ai>
This commit is contained in:
Cursor Agent
2025-07-02 01:49:00 +00:00
committed by Kent Keirsey
parent 324b6e2af4
commit 6f12fd22b9

View File

@@ -270,25 +270,13 @@ export const imagesApi = api.injectEndpoints({
// Don't add it to anything
return [];
}
const categories = getCategories(result);
const boardId = result.board_id ?? 'none';
return [
{
type: 'ImageList',
id: getListImagesUrl({
board_id: boardId,
categories,
}),
},
{
type: 'Board',
id: boardId,
},
{
type: 'BoardImagesTotal',
id: boardId,
},
...getTagsToInvalidateForImageMutation([result.image_name]),
...getTagsToInvalidateForBoardAffectingMutation([boardId]),
'ImageCollectionCounts',
{ type: 'ImageCollection', id: LIST_TAG },
];
},
}),