Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Refactor site-related API and component handling

Bill Yangc254f115a830
diff --git a/client/src/api/admin/sites.ts b/client/src/api/admin/sites.ts
index 47ed30a70..dc95806ea 100644
--- a/client/src/api/admin/sites.ts
+++ b/client/src/api/admin/sites.ts
@@ -162,11 +162,10 @@ export function useGetSite(siteId?: string | number) {
return null;
}
- // Use regular fetch instead of authedFetch to support public sites
const data = await authedFetch<SiteResponse>(`/sites/${siteIdToUse}`);
return data;
},
- staleTime: 60000, // 1 minute
+ staleTime: 60000,
enabled: !!siteId,
});
}
@@ -187,7 +186,7 @@ export function useGetSiteIsPublic(siteId?: string | number) {
return false;
}
},
- staleTime: 60000, // 1 minute
+ staleTime: 60000,
enabled: !!siteId,
});
}
diff --git a/client/src/app/[site]/components/Sidebar/SiteSelector.tsx b/client/src/app/[site]/components/Sidebar/SiteSelector.tsx
index 9d8cea4d6..eb71d4bf7 100644
--- a/client/src/app/[site]/components/Sidebar/SiteSelector.tsx
+++ b/client/src/app/[site]/components/Sidebar/SiteSelector.tsx
@@ -31,10 +31,10 @@ function SiteSelectorContent({ onSiteSelect }: { onSiteSelect: () => void }) {
<PopoverContent align="start" className="w-52 p-2">
<div className="max-h-96 overflow-y-auto">
{[
- {
- siteId: 21,
- domain: "rybbit.com",
- },
+ // {
+ // siteId: 21,
+ // domain: "rybbit.com",
+ // },
{
siteId: 1,
domain: "tomato.gg",
diff --git a/server/src/index.ts b/server/src/index.ts
index e0f6a3b6b..0b52e8448 100644
--- a/server/src/index.ts
+++ b/server/src/index.ts
@@ -232,6 +232,7 @@ const ANALYTICS_ROUTES = [
"/api/metric/",
"/api/page-titles/",
"/api/retention/",
+ "/api/sites/",
"/api/site-has-data/",
"/api/site-is-public/",
"/api/sessions/",
@@ -242,7 +243,6 @@ const ANALYTICS_ROUTES = [
"/api/goals/",
"/api/events/",
"/api/events/outbound/",
- "/api/get-site/",
"/api/performance/overview/",
"/api/performance/time-series/",
"/api/performance/by-dimension/",