Skip to content

Commit 6d9f3ef

Browse files
fixed bug
1 parent 3ca9ca6 commit 6d9f3ef

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"version": "2.0.0",
44
"description": "A collection of Vue components and mixins for use with WordPress and the WP-REST API",
55
"author": "WakeCoder <ajqajq@gmail.com>",
6-
"contributes": {"Cameron Beck":"cameron-beck-coding <cameron@pixelthin.com>"},
6+
"contributes": {
7+
"Cameron Beck": "cameron-beck-coding <cameron@pixelthin.com>"
8+
},
79
"scripts": {
810
"dev": "node build/dev-server.js",
911
"start": "node build/dev-server.js",

src/mixins/wp-mixin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import safeGet from 'safe-get'
33
import 'whatwg-fetch'
44

55
// wpGet just wraps some of the basic fetch boilerplate
6-
const wpGet = function ({ url, mapper, fetchOptions }) {
6+
const wpGet = function ({ url, mapper, fetchOptions,errorCallback }) {
77
return fetch(url, fetchOptions)
88
.then(res => {
99
if (!res.ok) {
@@ -28,7 +28,7 @@ export default {
2828
* @param {object} fetchOptions - An object that contains options for the fetch call. See https://github.github.io/fetch/ for more
2929
* informaiton. NOTE: Must set {credentials: 'include' | 'same-site'} for endpoints requiring cookie authentication.
3030
*/
31-
createWpLoader(url, options, fetchOptions) {
31+
createWpLoader(url, options, fetchOptions,errorCallback) {
3232
let mapper = options.mapper ? options.mapper : this.mapPosts
3333
url += options.embed !== false ? '?_embed&' : '?'
3434
if (safeGet(options, 'queryParams.length') > 0) {
@@ -42,7 +42,7 @@ export default {
4242
const pageToLoad = loader.pagesLoaded + 1
4343
const newPage = { loaded: false, content: [] }
4444
loader.pages.push(newPage)
45-
wpGet({ url: url + 'page=' + pageToLoad, mapper, fetchOptions }).then(content => {
45+
wpGet({ url: url + 'page=' + pageToLoad, mapper, fetchOptions,errorCallback }).then(content => {
4646
newPage.content = content
4747
newPage.loaded = true
4848
loader.pagesLoaded++

0 commit comments

Comments
 (0)