diff --git a/packages/gitbook/src/app/(space)/fetch.ts b/packages/gitbook/src/app/(space)/fetch.ts index 675568382..45a0d6ceb 100644 --- a/packages/gitbook/src/app/(space)/fetch.ts +++ b/packages/gitbook/src/app/(space)/fetch.ts @@ -200,18 +200,18 @@ async function fetchParentSite(args: { getSiteSpaces({ organizationId, siteId, siteShareKey }), ]); - const spaces: Record = {}; + const spaces: Array = []; siteSpaces.forEach((siteSpace) => { - spaces[siteSpace.space.id] = { + spaces.push({ ...siteSpace.space, urls: { ...siteSpace.space.urls, published: siteSpace.urls.published, }, - }; + }); }); - return { parent: site, spaces: Object.values(spaces) }; + return { parent: site, spaces }; } /**