File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-wordpress" ,
3
- "version" : " 1.1 .0" ,
3
+ "version" : " 1.2 .0" ,
4
4
"description" : " A collection of Vue components and mixins for use with WordPress and the WP-REST API" ,
5
5
"author" : " WakeCoder <ajqajq@gmail.com>" ,
6
+ "contributes" : {"Cameron Beck" :" cameron-beck-coding <cameron@pixelthin.com>" },
6
7
"scripts" : {
7
8
"dev" : " node build/dev-server.js" ,
8
9
"start" : " node build/dev-server.js" ,
Original file line number Diff line number Diff line change @@ -5,7 +5,12 @@ import 'whatwg-fetch'
5
5
// wpGet just wraps some of the basic fetch boilerplate
6
6
const wpGet = function ( { url, mapper, fetchOptions } ) {
7
7
return fetch ( url , fetchOptions )
8
- . then ( res => res . json ( ) )
8
+ . then ( res => {
9
+ if ( ! res . ok ) {
10
+ errorCallback ( res )
11
+ }
12
+ return res . json ( )
13
+ } )
9
14
. then ( json => {
10
15
return mapper ( json )
11
16
} )
@@ -42,6 +47,7 @@ export default {
42
47
newPage . loaded = true
43
48
loader . pagesLoaded ++
44
49
} )
50
+ . catch ( reason => { errorCallback ( reason ) } )
45
51
} ,
46
52
pagesLeft : true // This should be updated based on the X-WP-TotalPages header and pagesLoaded
47
53
}
You can’t perform that action at this time.
0 commit comments