fix(ui): do not invalidate image dto cache when deleting image

This commit is contained in:
psychedelicious 2024-07-12 10:51:07 +10:00
parent 0f65a12cf3
commit fb1130c644

View File

@ -93,7 +93,6 @@ export const imagesApi = api.injectEndpoints({
const boardId = imageDTO.board_id ?? 'none';
return [
{ type: 'Image', id: imageDTO.image_name },
{
type: 'ImageList',
id: getListImagesUrl({
@ -138,9 +137,6 @@ export const imagesApi = api.injectEndpoints({
id: boardId,
},
];
for (const imageDTO of imageDTOs) {
tags.push({ type: 'Image', id: imageDTO.image_name });
}
return tags;
}
@ -508,7 +504,6 @@ export const imagesApi = api.injectEndpoints({
export const {
useGetIntermediatesCountQuery,
useListImagesQuery,
useGetImageDTOQuery,
useGetImageMetadataQuery,
useGetImageWorkflowQuery,
useLazyGetImageWorkflowQuery,
@ -526,6 +521,10 @@ export const {
useBulkDownloadImagesMutation,
} = imagesApi;
export const useGetImageDTOQuery = (...args: Parameters<typeof imagesApi.useGetImageDTOQuery>) => {
return imagesApi.useGetImageDTOQuery(...args);
};
/**
* Imperative RTKQ helper to fetch an ImageDTO.
* @param image_name The name of the image to fetch