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