Update useGetAsset.tsx

This commit is contained in:
Nate Kelley 2025-08-04 21:42:41 -06:00
parent 255460b0e3
commit 0c0973195d
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 12 additions and 9 deletions

View File

@ -118,6 +118,18 @@ export const useGetAsset = (
{ enabled: isDashboard, select: (x) => x?.dashboard?.name, staleTime: Infinity }
);
const {
isFetched: reportIsFetched,
error: reportError,
isError: reportIsError,
data: reportTitle
} = useGetReport(
{ reportId: isReport ? props.assetId : undefined, versionNumber },
{
select: (x) => x?.name
}
);
const {
isFetched: collectionIsFetched,
error: collectionError,
@ -127,15 +139,6 @@ export const useGetAsset = (
select: (x) => x?.name
});
const {
isFetched: reportIsFetched,
error: reportError,
isError: reportIsError,
data: reportTitle
} = useGetReport(isReport ? props.assetId : undefined, {
select: (x) => x?.name
});
const currentQuery = useMemo((): AssetQueryResult => {
switch (props.type) {
case 'metric':