how to use response from first API and and call second API , SSR and redux #12395
Unanswered
Rakeshtagadghar
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I was wondering what is the best way to handle this case,
2.wait for first api response.
is there any way to wait till first api response and use it for second api and using redux
I need both apis data to be server rendered.
`DashboardPage.getInitialProps = async ({ store, res }) => {
const getstate = await store.getState();
const userId = getstate?.profileReducer?.profile?.userId;
if (userId) {
const payload = {
userId,
};
await store.dispatch(getInvestorByContactPerson(payload));
}
return {};
};`
Beta Was this translation helpful? Give feedback.
All reactions