From 5d3be1c36282044f8b18daa39da9cff99af19275 Mon Sep 17 00:00:00 2001 From: Carson <104383295+codebycarson@users.noreply.github.com> Date: Fri, 5 Jul 2024 09:43:55 -0700 Subject: [PATCH] Fixed ecosystem api endpoint --- data/ecosystemData.ts | 76 +++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/data/ecosystemData.ts b/data/ecosystemData.ts index d9e978e..f6dd934 100644 --- a/data/ecosystemData.ts +++ b/data/ecosystemData.ts @@ -1,54 +1,54 @@ export type EcosystemAppLogoType = { - fileId: string; - url: string; - alt: string | null; + fileId: string; + url: string; + alt: string | null; }; export type EcosystemFieldData = { - "featured-app": boolean; - profile: string; - link: string; - "sei-only": boolean; - name: string; - slug: string; - logo: EcosystemAppLogoType; - categorie: string; + 'featured-app': boolean; + profile: string; + link: string; + 'sei-only': boolean; + name: string; + slug: string; + logo: EcosystemAppLogoType; + categorie: string; }; export type EcosystemItem = { - id: string; - cmsLocaleId: string; - lastPublished: string; - lastUpdated: string; - createdOn: string; - isArchived: boolean; - isDraft: boolean; - fieldData: EcosystemFieldData; + id: string; + cmsLocaleId: string; + lastPublished: string; + lastUpdated: string; + createdOn: string; + isArchived: boolean; + isDraft: boolean; + fieldData: EcosystemFieldData; }; export type EcosystemResponse = { - data: EcosystemItem[]; + data: EcosystemItem[]; }; export async function getSeiEcosystemAppsData(): Promise { - const url = "http://staging.app-api.seinetwork.io/webflow/ecosystem"; // TODO: Move to ENV - const headers = { Accept: 'application/json' }; + const url = 'http://app-api.seinetwork.io/webflow/ecosystem'; // TODO: Move to ENV + const headers = { Accept: 'application/json' }; - try { - const response = await fetch(url, { - method: "GET", - headers, - }); + try { + const response = await fetch(url, { + method: 'GET', + headers + }); - if (!response.ok) { - throw new Error(`HTTP error! Status: ${response.status}`); - } + if (!response.ok) { + throw new Error(`HTTP error! Status: ${response.status}`); + } - const data = await response.json(); - console.log("Sei Ecosystem data", data); - return data; - } catch (error) { - console.error("Failed to fetch data:", error); - return { data: [] }; - } -} \ No newline at end of file + const data = await response.json(); + console.log('Sei Ecosystem data', data); + return data; + } catch (error) { + console.error('Failed to fetch data:', error); + return { data: [] }; + } +}