Skip to content

Commit

Permalink
feat: updated endpoints because of reverse proxy config
Browse files Browse the repository at this point in the history
  • Loading branch information
JianLoong committed Jan 11, 2024
1 parent 4db4b08 commit cd7e236
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/Random.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function Random() {

const location = useLocation();

const randomEndPoint = "https://vmi1592589.contaboserver.net/api/v2/submissions/random";
const randomEndPoint = "https://vmi1592589.contaboserver.net/aita/api/v2/submissions/random";

let { data, error, mutate, isLoading } = useSWR(randomEndPoint, fetcher);

Expand Down
2 changes: 1 addition & 1 deletion src/components/ViewAIInference.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ShowAlert } from "./ShowAlert";
const fetcher = (url: string) => fetch(url).then((res) => res.json());

function useInference(id: Number){
const summaryEndPoint = `https://vmi1592589.contaboserver.net/api/v2/openai-analysis/${id}`;
const summaryEndPoint = `https://vmi1592589.contaboserver.net/aita/api/v2/openai-analysis/${id}`;

const {data, error, isLoading} = useSWR(summaryEndPoint, fetcher);

Expand Down
2 changes: 1 addition & 1 deletion src/components/ViewSubmission.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const fetcher = (url: string) => fetch(url).then((res) => res.json());

function useSummary(id: number) {

const summaryEndPoint = `https://vmi1592589.contaboserver.net/api/v2/summary/${id}`;
const summaryEndPoint = `https://vmi1592589.contaboserver.net/aita/api/v2/summary/${id}`;

const { data, error, isLoading } = useSWR(summaryEndPoint, fetcher, {
compare: (a, b) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ViewSubmissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const fetcher = (url: string) => fetch(url).then((res) => res.json());

function defaultSubmissions(startUTC: number, endUTC: number, noOfPost: number, selectedSortOrder: string) {

const indexesEndPoint = `https://vmi1592589.contaboserver.net/api/v2/submisssions/search?startUTC=${startUTC}&endUTC=${endUTC}&offset=0&limit=${noOfPost}&sortBy=${selectedSortOrder}&orderBy=desc`
const indexesEndPoint = `https://vmi1592589.contaboserver.net/aita/api/v2/submisssions/search?startUTC=${startUTC}&endUTC=${endUTC}&offset=0&limit=${noOfPost}&sortBy=${selectedSortOrder}&orderBy=desc`

const { data, error, isLoading } = useSWR(indexesEndPoint, fetcher);

Expand Down
2 changes: 1 addition & 1 deletion src/components/ViewSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const fetcher = (url: string) => fetch(url).then((res) => res.json());
export default function ViewSummary({ id }: Index) {
function useSummary(id: number) {

const summaryEndPoint = `https://vmi1592589.contaboserver.net/api/v2/summary/${id}`;
const summaryEndPoint = `https://vmi1592589.contaboserver.net/aita/api/v2/summary/${id}`;

const { data, error, isLoading } = useSWR(summaryEndPoint, fetcher);

Expand Down
2 changes: 1 addition & 1 deletion src/components/ViewTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function getCounts(
selectedYear: number) {

const keys: string[] = ["yta", "nta", "nah", "info", "esh"];
const { data, isLoading, error } = useSWRInfinite((index) => `https://vmi1592589.contaboserver.net/api/v2/submissions/top?year=${selectedYear}&month=${selectedMonth}&type=${keys[index]}`, fetcher, {
const { data, isLoading, error } = useSWRInfinite((index) => `https://vmi1592589.contaboserver.net/aita/api/v2/submissions/top?year=${selectedYear}&month=${selectedMonth}&type=${keys[index]}`, fetcher, {
initialSize: keys.length,
parallel: true,
});
Expand Down
2 changes: 1 addition & 1 deletion src/pages/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function About() {
</li>
<li>
<strong>FastAPI</strong> - FastAPI used for RESTful API backend.
Link can be found <a href="https://vmi1592589.contaboserver.net/docs">here</a>
Link can be found <a href="https://vmi1592589.contaboserver.net/aita/docs">here</a>
</li>
<li>
<strong>GH Pages</strong> - GH Pages are used to host these pages
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SearchSubmission.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function SearchSubmission() {
const [selectedSearchQuery, setSearchQuery] = useState<string>("");

const [shouldFetch, setShouldFetch] = useState<boolean>(false)
const fuzzySearchEndPoint = `https://vmi1592589.contaboserver.net/api/v2/submissions/fuzzy-search?query=${selectedSearchQuery}`
const fuzzySearchEndPoint = `https://vmi1592589.contaboserver.net/aita/api/v2/submissions/fuzzy-search?query=${selectedSearchQuery}`

const { data, error, isLoading } = useSWR(shouldFetch ? fuzzySearchEndPoint : null, fetcher);

Expand Down

0 comments on commit cd7e236

Please sign in to comment.