fix(ui): few cases where board totals don't updated when moving

This commit is contained in:
psychedelicious 2024-07-24 16:15:54 +10:00
parent 4fdefe58c7
commit ca5a4ee59d

View File

@ -382,6 +382,10 @@ export const imagesApi = api.injectEndpoints({
type: 'BoardImagesTotal',
id: imageDTO.board_id ?? 'none',
},
{
type: 'BoardImagesTotal',
id: board_id,
},
];
},
}),
@ -454,6 +458,10 @@ export const imagesApi = api.injectEndpoints({
}),
});
tags.push({ type: 'Board', id: imageDTOs[0].board_id ?? 'none' });
tags.push({
type: 'BoardImagesTotal',
id: imageDTOs[0].board_id ?? 'none',
});
}
for (const imageDTO of imageDTOs) {
tags.push({ type: 'Image', id: imageDTO.image_name });
@ -498,6 +506,10 @@ export const imagesApi = api.injectEndpoints({
categories: getCategories(imageDTOs[0]),
}),
});
tags.push({
type: 'BoardImagesTotal',
id: 'none',
});
}
result?.removed_image_names.forEach((image_name) => {