From cb9a15339df7f1bd050da703cb50e9449df5b280 Mon Sep 17 00:00:00 2001 From: taranvohra Date: Wed, 28 Aug 2024 16:05:44 +0530 Subject: [PATCH] Fix spaces list of a site --- packages/gitbook/src/app/(space)/fetch.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 }; } /**