-
Collection GET /wp/v2/posts Response [{id: 1, name: 'post'}, {id: 2, name: 'post2'}]
-
Signle entity GET /wp/v2/posts/1 Response {id: 1, name: 'test'}
-
Object collection GET /wp/v2/taxonomies Response { testA: { name: 'test a' }, testB: {name: 'test b'}, testC: { name: 'test c' }}
How will look store for different actions, READ, READ_FAIL, READ_SUCCESS ?
Please note we should be able to handle routes like this statging/test/posts/revision/1.
For complex routes it will be hard to distinguish where to put entities or data
So my understanding it would be easier to have smt like this in store
- Requested
posts: { status: 'requested' }
- Fail
posts: { status: 'fail', http: 401 } - Success
posts: { 1: { id: 1, name: 'post'}, 2: { id: 2, name: 'post2'} }
- Requested
posts: { 1: { status: 'requested' } } - Fail
posts: { 1: { status: 'failed', http: 500 } } - Success
posts: { 1: { id: 1, name: 'test' } }
- Requested
taxonomies: { status: 'requested' } - Fail
taxonomies: {
status: 'fail',
http: 500
}
- Success
taxonomies: {
testA: { name: 'test a' },
testB: { name: 'test b' },
testC: { name: 'test c' }
}