GitBook's API is sending id instead of uid now
This commit is contained in:
parent
c331f8c330
commit
bc71311c8c
|
|
@ -82,7 +82,7 @@ function pushChildPages(masterPage) {
|
||||||
page.path = (masterPage.path || masterPage.ref) + "/" + page.path;
|
page.path = (masterPage.path || masterPage.ref) + "/" + page.path;
|
||||||
pushChildPages(page);
|
pushChildPages(page);
|
||||||
page.pages = undefined;
|
page.pages = undefined;
|
||||||
pages[page.uid] = page;
|
pages[page.id] = page;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -146,11 +146,11 @@ exports.handler = async (event, context, callback) => {
|
||||||
getAllPages(Object.keys(pages)).then(updatedPages => {
|
getAllPages(Object.keys(pages)).then(updatedPages => {
|
||||||
// console.log("fetched all pages ", Object.keys(pages));
|
// console.log("fetched all pages ", Object.keys(pages));
|
||||||
updatedPages.forEach((page, index) => {
|
updatedPages.forEach((page, index) => {
|
||||||
// console.log("update page fullpath", page.uid);
|
// console.log("update page fullpath", page.id);
|
||||||
page.path = pages[page.uid].path;
|
page.path = pages[page.id].path;
|
||||||
delete page.pages;
|
delete page.pages;
|
||||||
page.objectID = page.uid;
|
page.objectID = page.id;
|
||||||
delete page.uid;
|
delete page.id;
|
||||||
});
|
});
|
||||||
updatedPages.sort((pageA, pageB) => {
|
updatedPages.sort((pageA, pageB) => {
|
||||||
const orderA = orderMap[pageA.path] || 999;
|
const orderA = orderMap[pageA.path] || 999;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user