From 770ccf59d9df2ae20b1dc0e4fe0e753ca179336a Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 6 Oct 2022 20:57:53 +0100 Subject: [PATCH] fix: remove unnecessary await --- src/models/site.model.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/models/site.model.ts b/src/models/site.model.ts index 31eabd37..10a6613f 100644 --- a/src/models/site.model.ts +++ b/src/models/site.model.ts @@ -13,7 +13,7 @@ export const checkSubdomain = async ({ updatingSiteId?: string }) => {} -const expandSite = async (site: Profile) => { +const expandSite = (site: Profile) => { site.navigation = JSON.parse( site.metadata?.raw?.attributes?.find( (a: any) => a.trait_type === "xlog_navigation", @@ -69,12 +69,10 @@ export const getUserSites = async ( }, }) - const sites: Profile[] = await Promise.all( - profiles.list?.map(async (profile) => { - await expandSite(profile) - return profile - }), - ) + const sites: Profile[] = profiles.list?.map((profile) => { + expandSite(profile) + return profile + }) if (!sites || !sites.length) return null @@ -90,7 +88,7 @@ export const getSite = async (input: string, customUnidata?: Unidata) => { const site: Profile = profiles.list[0] if (site) { - await expandSite(site) + expandSite(site) } return site