From 77de8903473d2c552eac9bb5133db0a99b9ddf03 Mon Sep 17 00:00:00 2001 From: uo269745 Date: Mon, 1 May 2023 10:58:45 +0200 Subject: [PATCH] removing permanent URL --- webapp/src/api/api.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/webapp/src/api/api.ts b/webapp/src/api/api.ts index 8438cb9..79b2b31 100644 --- a/webapp/src/api/api.ts +++ b/webapp/src/api/api.ts @@ -15,7 +15,7 @@ export function logout() { } export async function signup(user: User): Promise { - const apiEndPoint = 'http://20.169.248.119:5000/api' || process.env.REACT_APP_API_URI || 'http://localhost:5000/api' + const apiEndPoint = process.env.REACT_APP_API_URI || 'http://localhost:5000/api' let response = await fetch(apiEndPoint + '/sesionmanager/signup', { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -33,7 +33,7 @@ export async function signup(user: User): Promise { } export async function login(user: User): Promise { - const apiEndPoint = 'http://20.169.248.119:5000/api' || process.env.REACT_APP_API_URI || 'http://localhost:5000/api' + const apiEndPoint = process.env.REACT_APP_API_URI || 'http://localhost:5000/api' console.log(apiEndPoint) let response = await fetch(apiEndPoint + '/sesionmanager/login', { @@ -60,7 +60,7 @@ async function setSessionUser(response: Response): Promise { } export async function editUserDetails(user: User): Promise { - const apiEndPoint = 'http://20.169.248.119:5000/api' || process.env.REACT_APP_API_URI || 'http://localhost:5000/api' + const apiEndPoint = process.env.REACT_APP_API_URI || 'http://localhost:5000/api' let response = await fetch(apiEndPoint + '/usermanager/edit', { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -78,7 +78,7 @@ export async function editUserDetails(user: User): Promise { } export async function getMyFriends(user: User): Promise { - const apiEndPoint = 'http://20.169.248.119:5000/api' || process.env.REACT_APP_API_URI || 'http://localhost:5000/api' + const apiEndPoint = process.env.REACT_APP_API_URI || 'http://localhost:5000/api' let response = await fetch(apiEndPoint + '/friendmanager/friends', { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -96,7 +96,7 @@ export async function getMyFriends(user: User): Promise { } export async function sendFriendRequest(user: User): Promise { - const apiEndPoint = 'http://20.169.248.119:5000/api' || process.env.REACT_APP_API_URI || 'http://localhost:5000/api' + const apiEndPoint = process.env.REACT_APP_API_URI || 'http://localhost:5000/api' let response = await fetch(apiEndPoint + '/friendmanager/add', { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -113,7 +113,7 @@ export async function sendFriendRequest(user: User): Promise { } export async function searchUserByUsername(username: string): Promise { - const apiEndPoint = 'http://20.169.248.119:5000/api' || process.env.REACT_APP_API_URI || 'http://localhost:5000/api' + const apiEndPoint = process.env.REACT_APP_API_URI || 'http://localhost:5000/api' try { let response = await fetch(`${apiEndPoint}/usermanager/searchUserByUsername?username=${username}`, { method: 'GET' }) .then(async (res) => {