diff options
| author | Pinapelz <donaldshan1@outlook.com> | 2023-12-15 13:29:02 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-15 13:29:02 -0800 |
| commit | 6574eb518e4dd1181d2c468963fbed920c84ac09 (patch) | |
| tree | 35fa9506b10fb5f1aa68a4f909912d04d99a5819 | |
| parent | e1df1ff16bce76bb3c21d80e96db08b5a1ec28a2 (diff) | |
| parent | f65d70af9c1118d10efd78ceb8065d31ee1999c5 (diff) | |
Merge pull request #5 from pinapelz/new_api
Implement new API for PhaseTrack
| -rw-r--r-- | src/app/page.tsx | 6 | ||||
| -rw-r--r-- | src/pages/stats/[slug].tsx | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/app/page.tsx b/src/app/page.tsx index ed29653..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 + const graphURL = process.env.NEXT_PUBLIC_GRAPH_URL const data: SubscriberDataTableProp = await getData(); return( <> <TitleBar title="PhaseTracker" backgroundColor='black' /> <div className="sm:block hidden mt-4" style={{ overflow: 'hidden', height: '105vh', position: 'relative' }}> - <iframe src={apiUrl} style={{ position: 'absolute', top: 0, left: 0 }} width="100%" height="100%"></iframe> + <iframe src={graphURL} style={{ position: 'absolute', top: 0, left: 0 }} width="100%" height="100%"></iframe> </div> <SubscriberTable {...data} /> </> @@ -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' |
