From 434d64548ee3c433fa49bb47f6d5bb8542118865 Mon Sep 17 00:00:00 2001 From: iAmir Date: Fri, 6 Oct 2023 06:50:48 +0330 Subject: [PATCH] frontend: deprecate old api endpoint, use latest --- frontend/src/components/listing/hooks.ts | 2 +- frontend/src/pages/partners.tsx | 2 +- frontend/src/pages/servers/[ip].tsx | 2 +- frontend/src/pages/servers/index.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/listing/hooks.ts b/frontend/src/components/listing/hooks.ts index 00d4cbe0c..61b0c3f46 100644 --- a/frontend/src/components/listing/hooks.ts +++ b/frontend/src/components/listing/hooks.ts @@ -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; diff --git a/frontend/src/pages/partners.tsx b/frontend/src/pages/partners.tsx index facea3544..1c1bb35d4 100644 --- a/frontend/src/pages/partners.tsx +++ b/frontend/src/pages/partners.tsx @@ -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> => { const r: Response = await fetch(API_SERVERS); diff --git a/frontend/src/pages/servers/[ip].tsx b/frontend/src/pages/servers/[ip].tsx index aaa5410a4..0866c904a 100644 --- a/frontend/src/pages/servers/[ip].tsx +++ b/frontend/src/pages/servers/[ip].tsx @@ -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)}`; diff --git a/frontend/src/pages/servers/index.tsx b/frontend/src/pages/servers/index.tsx index 5910d06c6..baf3bd70f 100644 --- a/frontend/src/pages/servers/index.tsx +++ b/frontend/src/pages/servers/index.tsx @@ -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> => { const r: Response = await fetch(API_SERVERS);