diff --git a/awx/ui_next/src/screens/Job/JobTypeRedirect.jsx b/awx/ui_next/src/screens/Job/JobTypeRedirect.jsx index bf36a1a14c..599fc402a9 100644 --- a/awx/ui_next/src/screens/Job/JobTypeRedirect.jsx +++ b/awx/ui_next/src/screens/Job/JobTypeRedirect.jsx @@ -18,8 +18,11 @@ function JobTypeRedirect({ id, path, view, i18n }) { request: loadJob, } = useRequest( useCallback(async () => { - const { data } = await UnifiedJobsAPI.read({ id }); - return { job: data }; + const { + data: { results }, + } = await UnifiedJobsAPI.read({ id }); + const [item] = results; + return { job: item }; }, [id]), { job: {} } ); @@ -42,7 +45,7 @@ function JobTypeRedirect({ id, path, view, i18n }) { ); } - if (isLoading) { + if (isLoading || !job?.id) { // TODO show loading state return