Skip to content

Commit

Permalink
frontend: deprecate old api endpoint, use latest
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyrAhmady committed Oct 6, 2023
1 parent 53de1b9 commit 434d645
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/listing/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useMutationAPI } from "src/fetcher/hooks";
import { All } from "src/types/_generated_Server";

// TODO: Remove this when server listing is refactored.
const mutateKey = `${API_ADDRESS}/server/`;
const mutateKey = `${API_ADDRESS}/servers/`;

type DeleteServerPayload = { time: string };
type DeleteServerFn = (ip: string) => void;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/partners.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { API_ADDRESS } from "src/config";
import { Essential } from "src/types/_generated_Server";
import useSWR from "swr";

const API_SERVERS = `${API_ADDRESS}/server/`;
const API_SERVERS = `${API_ADDRESS}/servers/`;

const getServers = async (): Promise<Array<Essential>> => {
const r: Response = await fetch(API_SERVERS);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/servers/[ip].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { API_ADDRESS } from "src/config";
import { All } from "src/types/_generated_Server";
import useSWR from "swr";

const API_PATH = (ip: string) => `/server/${ip}`;
const API_PATH = (ip: string) => `/servers/${ip}`;

const API_SERVER = (ip: string) => `${API_ADDRESS}${API_PATH(ip)}`;

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/servers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { API_ADDRESS } from "src/config";
import { All, Essential } from "src/types/_generated_Server";
import useSWR from "swr";

const API_SERVERS = `${API_ADDRESS}/server/`;
const API_SERVERS = `${API_ADDRESS}/servers/`;

const getServers = async (): Promise<Array<Essential>> => {
const r: Response = await fetch(API_SERVERS);
Expand Down

0 comments on commit 434d645

Please sign in to comment.