Skip to content

Commit

Permalink
Merge pull request #167 from Arquisoft/develop
Browse files Browse the repository at this point in the history
test apiEndPoint
  • Loading branch information
paulasuarezp authored May 1, 2023
2 parents 7fed10b + 87b3fb0 commit 90ce6e5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 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 = process.env.REACT_APP_API_URI || 'http://localhost:5000/api'
const apiEndPoint = 'http://20.169.248.119:5000/api' || 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 Down Expand Up @@ -60,7 +60,7 @@ async function setSessionUser(response: Response): Promise<User> {
}

export async function editUserDetails(user: User): Promise<User> {
const apiEndPoint = process.env.REACT_APP_API_URI || 'http://localhost:5000/api'
const apiEndPoint = 'http://20.169.248.119:5000/api' || 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 = process.env.REACT_APP_API_URI || 'http://localhost:5000/api'
const apiEndPoint = 'http://20.169.248.119:5000/api' || 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 = process.env.REACT_APP_API_URI || 'http://localhost:5000/api'
const apiEndPoint = 'http://20.169.248.119:5000/api' || 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 = process.env.REACT_APP_API_URI || 'http://localhost:5000/api';
const apiEndPoint = 'http://20.169.248.119:5000/api' || 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 90ce6e5

Please sign in to comment.