From f1f78ff0b6df53a83e653c2e031232b03acb26e8 Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Thu, 21 Dec 2023 10:57:21 -0800 Subject: [PATCH] feat: use v2 pr/search (#16) * use v2 pr/search * fix build --- .env | 1 + .github/workflows/compliance.yml | 2 +- .github/workflows/development.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/triage.yml | 2 +- hooks/useSWR.ts | 4 ++-- pages/[owner]/[repo]/index.tsx | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.env b/.env index 8e7282e..33082a8 100644 --- a/.env +++ b/.env @@ -1 +1,2 @@ NEXT_PUBLIC_API_URL=https://api.opensauced.pizza/v1 +NEXT_PUBLIC_V2_API_URL=https://beta.api.opensauced.pizza/v2 diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 210504e..d1d4208 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -12,4 +12,4 @@ permissions: jobs: compliance: - uses: open-sauced/open-sauced/.github/workflows/compliance.yml@main + uses: open-sauced/hot/.github/workflows/compliance.yml@main diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index fdb792d..caf7377 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -10,4 +10,4 @@ on: jobs: test: - uses: open-sauced/open-sauced/.github/workflows/development.yml@main + uses: open-sauced/hot/.github/workflows/development.yml@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c271a53..ca480e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: test: name: Test and lint - uses: open-sauced/open-sauced/.github/workflows/development.yml@main + uses: open-sauced/hot/.github/workflows/development.yml@main build: name: Build application diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 8f11e9c..26b7157 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -8,4 +8,4 @@ on: jobs: assign: - uses: open-sauced/open-sauced/.github/workflows/triage.yml@main + uses: open-sauced/hot/.github/workflows/triage.yml@main diff --git a/hooks/useSWR.ts b/hooks/useSWR.ts index 9c044ea..614c9b0 100644 --- a/hooks/useSWR.ts +++ b/hooks/useSWR.ts @@ -1,6 +1,6 @@ import { Fetcher } from "swr"; -const baseUrl = process.env.NEXT_PUBLIC_API_URL; +const baseUrl = process.env.NEXT_PUBLIC_V2_API_URL; const apiFetcher: Fetcher = async (apiUrl: string) => { const res = await fetch(`${baseUrl}/${apiUrl}`, { headers: { accept: "application/json" } }); @@ -17,4 +17,4 @@ const apiFetcher: Fetcher = async (apiUrl: string) => { return res.json(); }; -export default apiFetcher; \ No newline at end of file +export default apiFetcher; diff --git a/pages/[owner]/[repo]/index.tsx b/pages/[owner]/[repo]/index.tsx index 6b55a03..1376f40 100644 --- a/pages/[owner]/[repo]/index.tsx +++ b/pages/[owner]/[repo]/index.tsx @@ -15,7 +15,7 @@ interface PaginatedDataResponse { const ChildWithSWR = (props: { owner: string; repo: string }) => { const { owner, repo } = props; const { data, error, mutate } = useSWR( - `repos/${owner}/${repo}/contributions` + `prs/search?repo=${owner}%2F${repo}` ); if (!data) {