Site icon Hip-Hop Website Design and Development

wp-api Spine JS Consumer fetch choices

I’m making a webapp primarily based on wordpress during which I’m utilizing the REST API for my customers to get and create posts.

I discovered the very helpful REST API spine javascript consumer which appears nice.
Nonetheless the documentation on this hyperlink is restricted to just a few chosen examples. Is there a extra full documentation? With extra examples?

I am making an attempt to filter posts by writer and standing. To show present consumer’s drafts and printed posts somewhere else.

How do you employ the ‘choices’? I am unable to perceive the place to filter by the writer nor standing. For the writer I attempted loads of variations like this one nevertheless it at all times return all of the posts.

new wp.api.collections.Posts( { knowledge: { 'writer': { 'id': '1' }} } ).fetch().then( posts => { 
    for(const submit of posts){
        //do stuff with submit
    }
} );

Beside if I miss choices, it does not return the draft posts, solely printed posts.
Thanks!!