aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/.server/api/client.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-04 20:48:50 +0900
committernsfisis <nsfisis@gmail.com>2024-08-04 20:48:50 +0900
commitf4bae7f755ca25b2547dc98b2db2fdb255948bc5 (patch)
tree4690c2aabafaedb50f86ece4900c9616d9518947 /frontend/app/.server/api/client.ts
parent3963dedada8fdc43b18dfec1313c184d2f4fdc47 (diff)
downloadphperkaigi-2025-albatross-f4bae7f755ca25b2547dc98b2db2fdb255948bc5.tar.gz
phperkaigi-2025-albatross-f4bae7f755ca25b2547dc98b2db2fdb255948bc5.tar.zst
phperkaigi-2025-albatross-f4bae7f755ca25b2547dc98b2db2fdb255948bc5.zip
chore: remove admin APIs to communicate between app-server and api-server
Diffstat (limited to 'frontend/app/.server/api/client.ts')
-rw-r--r--frontend/app/.server/api/client.ts49
1 files changed, 1 insertions, 48 deletions
diff --git a/frontend/app/.server/api/client.ts b/frontend/app/.server/api/client.ts
index a78180b..0db4c14 100644
--- a/frontend/app/.server/api/client.ts
+++ b/frontend/app/.server/api/client.ts
@@ -1,5 +1,5 @@
import createClient from "openapi-fetch";
-import type { operations, paths } from "./schema";
+import type { paths } from "./schema";
const apiClient = createClient<paths>({
baseUrl:
@@ -46,50 +46,3 @@ export async function apiGetToken(token: string) {
if (error) throw new Error(error.message);
return data;
}
-
-export async function adminApiGetUsers(token: string) {
- const { data, error } = await apiClient.GET("/admin/users", {
- params: {
- header: { Authorization: `Bearer ${token}` },
- },
- });
- if (error) throw new Error(error.message);
- return data;
-}
-
-export async function adminApiGetGames(token: string) {
- const { data, error } = await apiClient.GET("/admin/games", {
- params: {
- header: { Authorization: `Bearer ${token}` },
- },
- });
- if (error) throw new Error(error.message);
- return data;
-}
-
-export async function adminApiGetGame(token: string, gameId: number) {
- const { data, error } = await apiClient.GET("/admin/games/{game_id}", {
- params: {
- header: { Authorization: `Bearer ${token}` },
- path: { game_id: gameId },
- },
- });
- if (error) throw new Error(error.message);
- return data;
-}
-
-export async function adminApiPutGame(
- token: string,
- gameId: number,
- body: operations["adminPutGame"]["requestBody"]["content"]["application/json"],
-) {
- const { data, error } = await apiClient.PUT("/admin/games/{game_id}", {
- params: {
- header: { Authorization: `Bearer ${token}` },
- path: { game_id: gameId },
- },
- body,
- });
- if (error) throw new Error(error.message);
- return data;
-}