mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Don't build redirect until data available
This commit is contained in:
parent
d35732c4b7
commit
19f855717d
@ -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 }) {
|
||||
</PageSection>
|
||||
);
|
||||
}
|
||||
if (isLoading) {
|
||||
if (isLoading || !job?.id) {
|
||||
// TODO show loading state
|
||||
return <div>Loading...</div>;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user