diff --git a/frontend/src/API/API.ts b/frontend/src/API/API.ts deleted file mode 100644 index 2dbd51e..0000000 --- a/frontend/src/API/API.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { NewUser, User } from "../Types/Users"; - -// Defines all the methods that an instance of the API must implement -interface API { - /** Register a new user */ - registerUser(user: NewUser): Promise; - /** Remove a user */ - removeUser(username: string): Promise; -} - -// Export an instance of the API -export const api: API = { - async registerUser(user: NewUser): Promise { - return fetch("/api/register", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(user), - }).then((res) => res.json() as Promise); - }, - - async removeUser(username: string): Promise { - return fetch("/api/userdelete", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(username), - }).then((res) => res.json() as Promise); - }, -}; diff --git a/frontend/src/API/README.md b/frontend/src/API/README.md deleted file mode 100644 index cba9b03..0000000 --- a/frontend/src/API/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# API - -This file contains the high-level API interface and implementation. diff --git a/frontend/src/Types/README.md b/frontend/src/Types/README.md deleted file mode 100644 index 8ea4251..0000000 --- a/frontend/src/Types/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Types - -This directory contains TypeScript type definitions for the frontend. -This is primarily used by, but not limited to, the API responses and requests. diff --git a/frontend/src/Types/Users.ts b/frontend/src/Types/Users.ts deleted file mode 100644 index 2a195b2..0000000 --- a/frontend/src/Types/Users.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This is how the API responds -export interface User { - id: number; - name: string; -} - -// Used to create a new user -export interface NewUser { - name: string; - password: string; -}