storyblok / storyblok-js-client

Universal JavaScript client for Storyblok's API
MIT License
127 stars 87 forks source link

filter_query gt-date needs better documentation #7

Closed frankiezz09 closed 6 years ago

frankiezz09 commented 6 years ago

Hi everyone, I was trying to follow through the Storyblok documentation for Nuxt.js and I really find it hard to understand how we can use filter_query to get stories beyond a certain 'published_at' date. Here's my code snippet based on how I understand it from the documentation here (https://www.storyblok.com/docs/Delivery-Api/get-a-story)

return context.app.$storyapi 
.get('cdn/stories/', { 
    version: version, 
    filter_query: { 
        published_at: { 
            'gt-date': '2018-03-03 10:00', 
        }, 
    },
}).then(res => {
       ... rest of the code here
})

Using this snippet without the filter_query works fine, so I figured I may have been confused at some point on the usage of filter_query. Can anyone help me out on this or could refer me to a better documentation on my use case?

Edit: Sorry about the code format.

DominikAngerer commented 6 years ago

We'll introduce a rewrite of the documentation including an example area in the coming months! This will also allow examples added via github! I'm closing this for now - thanks for the feedback! If you have any questions or need help with a query feel free to meanwhile contact our live-chat directly :)