From d25c4ff7f2252f363c7403cd2ad807c46caf2383 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Fri, 15 Dec 2023 10:44:09 -0800 Subject: point env vars to new testing API endpoint --- src/app/page.tsx | 4 ++-- src/pages/stats/[slug].tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index ed29653..e02e26e 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -2,7 +2,7 @@ import SubscriberTable, {SubscriberDataTableProp} from '../components/Subscriber import TitleBar from '../components/TitleBar/TitleBar'; async function Home(){ - const apiUrl = process.env.NEXT_PUBLIC_API_URL + const apiUrl = process.env.NEXT_PUBLIC_API_URL_TESTING const data: SubscriberDataTableProp = await getData(); return( <> @@ -16,7 +16,7 @@ async function Home(){ } async function getData(){ - const apiUrl = process.env.NEXT_PUBLIC_API_URL + const apiUrl = process.env.NEXT_PUBLIC_API_URL_TESTING const response = await fetch(apiUrl+'/api/subscribers', { headers: { 'Cache-Control': 'no-cache' diff --git a/src/pages/stats/[slug].tsx b/src/pages/stats/[slug].tsx index fc3f8bf..c6d8703 100644 --- a/src/pages/stats/[slug].tsx +++ b/src/pages/stats/[slug].tsx @@ -84,7 +84,7 @@ function Page({ chartData, channelData, sevenDayGraphData, slug }: { chartData: async function getGraphData(slug: string){ const encodedSlug = encodeURIComponent(slug as string); - const apiUrl = process.env.NEXT_PUBLIC_API_URL + const apiUrl = process.env.NEXT_PUBLIC_API_URL_TESTING const response = await fetch(apiUrl+`/api/subscribers/${encodedSlug}`, { headers: { 'Cache-Control': 'no-cache' @@ -99,7 +99,7 @@ async function getGraphData(slug: string){ async function getChannelData(slug: string){ const encodedSlug = encodeURIComponent(slug as string); - const apiUrl = process.env.NEXT_PUBLIC_API_URL + const apiUrl = process.env.NEXT_PUBLIC_API_URL_TESTING const response = await fetch(apiUrl+`/api/channel/${encodedSlug}`, { headers: { 'Cache-Control': 'no-cache' @@ -114,7 +114,7 @@ async function getChannelData(slug: string){ async function get7DGraphData(slug: string){ const encodedSlug = encodeURIComponent(slug as string); - const apiUrl = process.env.NEXT_PUBLIC_API_URL + const apiUrl = process.env.NEXT_PUBLIC_API_URL_TESTING const response = await fetch(apiUrl+`/api/subscribers/${encodedSlug}/7d`, { headers: { 'Cache-Control': 'no-cache' -- cgit v1.2.3 From f65d70af9c1118d10efd78ceb8065d31ee1999c5 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Fri, 15 Dec 2023 11:00:03 -0800 Subject: change graph url --- src/app/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index e02e26e..fb7f1a3 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -2,13 +2,13 @@ import SubscriberTable, {SubscriberDataTableProp} from '../components/Subscriber import TitleBar from '../components/TitleBar/TitleBar'; async function Home(){ - const apiUrl = process.env.NEXT_PUBLIC_API_URL_TESTING + const graphURL = process.env.NEXT_PUBLIC_GRAPH_URL const data: SubscriberDataTableProp = await getData(); return( <>
- +
-- cgit v1.2.3