Skip to content

Commit

Permalink
removing permanent URL
Browse files Browse the repository at this point in the history
  • Loading branch information
paulasuarezp committed May 1, 2023
1 parent 87b3fb0 commit 77de890
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions webapp/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function logout() {
}

export async function signup(user: User): Promise<User> {
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' },
Expand All @@ -33,7 +33,7 @@ export async function signup(user: User): Promise<User> {
}

export async function login(user: User): Promise<User> {
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', {
Expand All @@ -60,7 +60,7 @@ async function setSessionUser(response: Response): Promise<User> {
}

export async function editUserDetails(user: User): Promise<User> {
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' },
Expand All @@ -78,7 +78,7 @@ export async function editUserDetails(user: User): Promise<User> {
}

export async function getMyFriends(user: User): Promise<User[]> {
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' },
Expand All @@ -96,7 +96,7 @@ export async function getMyFriends(user: User): Promise<User[]> {
}

export async function sendFriendRequest(user: User): Promise<String> {
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' },
Expand All @@ -113,7 +113,7 @@ export async function sendFriendRequest(user: User): Promise<String> {
}

export async function searchUserByUsername(username: string): Promise<User> {
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) => {
Expand Down

0 comments on commit 77de890

Please sign in to comment.