update hooks to pass in DTO

This commit is contained in:
Mary Hipp 2023-09-01 13:03:06 -04:00 committed by psychedelicious
parent f8bb1f7a3e
commit ec2b44bfbd
3 changed files with 8 additions and 11 deletions

View File

@ -110,7 +110,7 @@ const CurrentImageButtons = (props: CurrentImageButtonsProps) => {
); );
const { metadata, workflow, isLoading } = useGetImageMetadataFromFileQuery( const { metadata, workflow, isLoading } = useGetImageMetadataFromFileQuery(
lastSelectedImage?.image_name ?? skipToken, lastSelectedImage ?? skipToken,
{ {
selectFromResult: (res) => ({ selectFromResult: (res) => ({
isLoading: res.isFetching, isLoading: res.isFetching,

View File

@ -52,7 +52,7 @@ const SingleSelectionMenuItems = (props: SingleSelectionMenuItemsProps) => {
const isCanvasEnabled = useFeatureStatus('unifiedCanvas').isFeatureEnabled; const isCanvasEnabled = useFeatureStatus('unifiedCanvas').isFeatureEnabled;
const { metadata, workflow, isLoading } = useGetImageMetadataFromFileQuery( const { metadata, workflow, isLoading } = useGetImageMetadataFromFileQuery(
imageDTO.image_name, imageDTO,
{ {
selectFromResult: (res) => ({ selectFromResult: (res) => ({
isLoading: res.isFetching, isLoading: res.isFetching,

View File

@ -27,15 +27,12 @@ const ImageMetadataViewer = ({ image }: ImageMetadataViewerProps) => {
// dispatch(setShouldShowImageDetails(false)); // dispatch(setShouldShowImageDetails(false));
// }); // });
const { metadata, workflow } = useGetImageMetadataFromFileQuery( const { metadata, workflow } = useGetImageMetadataFromFileQuery(image, {
image.image_name, selectFromResult: (res) => ({
{ metadata: res?.currentData?.metadata,
selectFromResult: (res) => ({ workflow: res?.currentData?.workflow,
metadata: res?.currentData?.metadata, }),
workflow: res?.currentData?.workflow, });
}),
}
);
return ( return (
<Flex <Flex