apps/web: combine ius requests to Promise.all
This commit is contained in:
parent
bb29d91b17
commit
00b245bc40
@ -26,20 +26,22 @@ export default async function Page({ params, searchParams }: PageProps) {
|
||||
render: async () => {
|
||||
const createUrl = makeCreateUrl(`/${params.slug}`, searchParams);
|
||||
|
||||
const data = await apiIUS.getData(createUrl);
|
||||
const metaData = await apiIUS.getMetaData(createUrl);
|
||||
const { title } = await apiIUS.getConfig(createUrl);
|
||||
return Promise.all([
|
||||
apiIUS.getData(createUrl),
|
||||
apiIUS.getMetaData(createUrl),
|
||||
apiIUS.getConfig(createUrl),
|
||||
]).then(([data, metaData, { title }]) => {
|
||||
const props = { data, metaData, title };
|
||||
|
||||
const props = { data, metaData, title };
|
||||
|
||||
return (
|
||||
<Background>
|
||||
<Form.Header {...props} url={'/ius' + createUrl('/conditions')} />
|
||||
<Form.Elements {...props} />
|
||||
<Divider />
|
||||
<Form.Buttons />
|
||||
</Background>
|
||||
);
|
||||
return (
|
||||
<Background>
|
||||
<Form.Header {...props} url={'/ius' + createUrl('/conditions')} />
|
||||
<Form.Elements {...props} />
|
||||
<Divider />
|
||||
<Form.Buttons />
|
||||
</Background>
|
||||
);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user