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

How to change/modify data from axios-call? #95

Open
iparker opened this issue Jun 22, 2023 · 0 comments
Open

How to change/modify data from axios-call? #95

iparker opened this issue Jun 22, 2023 · 0 comments

Comments

@iparker
Copy link

iparker commented Jun 22, 2023

Hello,

Is there a way to change/modify the data from the Axios call before storing it in the cache? I tried the following, unfortunately it doesn't work:

request: async () => {
  const axios = require('axios');
  const response = await axios.get(
    'my-url'
  );
  const data = response.data;

  // reduce/change data
  let data_reduced = data;
  delete data_reduced['delete-this-key'];

  return Promise.resolve({data: data_reduced});
}

When I query the data from the cache, I always get null back here.

Thanks for any help/feedback on this.

Best regards

Timo

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

1 participant