Skip to content

Commit

Permalink
Remove debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenhuyn committed Dec 27, 2023
1 parent a78c9a1 commit 2a307e8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/utility/Api.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import { Scenario } from "./Scenario";

console.log(window.location.host);
console.log(window.location.host.includes("plakait"));

const BACKEND_BASE_URL =
window.location.host.includes("plakait")
? new URL("https://plakait-backend-production.up.railway.app/")
: new URL("http://localhost:8000/");

console.log("BACKEND_BASE_URL:", BACKEND_BASE_URL);
const BACKEND_BASE_URL = window.location.host.includes("plakait")
? new URL("https://plakait-backend-production.up.railway.app/")
: new URL("http://localhost:8000/");

export type BotMessage = {
type: "Bot";
Expand Down Expand Up @@ -54,7 +48,9 @@ interface PostGameResponse {
gameId: string;
messages: Message[];
}
export const PostGame = async (scenario: Scenario): Promise<PostGameResponse> => {
export const PostGame = async (
scenario: Scenario
): Promise<PostGameResponse> => {
const requestOptions = {
method: "POST",
headers: { "Content-Type": "application/json" },
Expand All @@ -67,7 +63,9 @@ export const PostGame = async (scenario: Scenario): Promise<PostGameResponse> =>
if (response.ok) {
return response.json() as Promise<PostGameResponse>;
}
throw Error("Failed to initiate game - Server returned a non 200 response");
throw Error(
"Failed to initiate game - Server returned a non 200 response"
);
})
.catch(() => {
throw Error("Post Game Exception");
Expand All @@ -86,7 +84,9 @@ export const GetHistory = async (game_id: string): Promise<Message[]> => {
if (response.ok) {
return response.json() as Promise<Message[]>;
}
throw Error("Failed to Get game history - Server returned a non 200 response");
throw Error(
"Failed to Get game history - Server returned a non 200 response"
);
})
.catch(() => {
throw Error("Get History Exception");
Expand Down

0 comments on commit 2a307e8

Please sign in to comment.