Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When passing arguments with the function, function is returning undefined #31

Closed
Nishant-Adhikari opened this issue Nov 1, 2019 · 1 comment

Comments

@Nishant-Adhikari
Copy link

Nishant-Adhikari commented Nov 1, 2019

Function call

const response = await pRetry(() => { fetchbulkEditorItems(internalParams)}, {
          retries: API_RETRY
 });

Function

export const fetchbulkEditorItems = async (internalParams) => {

  const url = `${bulkEditorUrl}&${qs.stringify(internalParams)}`;
 
  const response = await fetch(url, {
    headers: apiHeaders
  });

  return response;
};
@acostalima
Copy link
Contributor

I think you're not passing fetchbulkEditorItems promise to pRetry. Try the code below:

const response = await pRetry(() => fetchbulkEditorItems(internalParams), { retries: API_RETRY });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants