1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-06-26 11:16:27 +02:00

move redirects into promise resolver

This commit is contained in:
Matthias Kretschmann 2018-11-29 10:53:35 +01:00
parent 524174a7c0
commit 01b692fab0
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -39,19 +39,6 @@ exports.onCreateNode = ({ node, getNode, actions }) => {
exports.createPages = ({ graphql, actions }) => {
const { createPage, createRedirect } = actions
//
// create redirects
//
redirects.forEach(({ from, to }) => {
createRedirect({
fromPath: from,
redirectInBrowser: true,
toPath: to
})
console.log('Create redirect: ' + from + ' --> ' + to)
})
return new Promise((resolve, reject) => {
resolve(
graphql(
@ -138,6 +125,19 @@ exports.createPages = ({ graphql, actions }) => {
})
})
//
// create redirects
//
redirects.forEach(({ from, to }) => {
createRedirect({
fromPath: from,
redirectInBrowser: true,
toPath: to
})
console.log('Create redirect: ' + from + ' --> ' + to)
})
resolve()
})
)