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 use this map data with Dynamic routes? #45

Closed
vedees opened this issue Feb 2, 2019 · 2 comments

Comments

@vedees
Copy link

commented Feb 2, 2019

My code:

return axios.all([
    axios.get('https://jsonplaceholder.typicode.com/users'),
    axios.get('https://jsonplaceholder.typicode.com/ico')
])
.then(axios.spread((users, ico) => [...users.data, ...ico.data]))

How to use this?

{
        url: '/page/2',
        changefreq: 'daily',
        priority: 1,
        lastmodISO: '2017-06-30T13:30:00.000Z'
}

With Dynamic routes? Right now it's assigning only url.

This question is available on Nuxt community (#c40)

@cmty cmty bot closed this Feb 2, 2019

@cmty cmty bot added the cmty:question label Feb 2, 2019

@cmty

This comment has been minimized.

Copy link

commented Feb 2, 2019

This issue as been imported as question since it does not respect sitemap-module issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/sitemap-module/issues/c40.

This comment has been minimized.

Copy link
Member

commented Feb 16, 2019 — with CMTY

you're just missing a transformation data step 😉

        .then(axios.spread((users, ico) => [...users.data, ...ico.data]))
        .then(data => data.map(item => ({
          url: 'item/' + item.id,
          changefreq: 'daily',
          priority: 1,
          lastmodISO: new Date().toISOString()
        })))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.