diff --git a/client/src/api/requests.ts b/client/src/api/requests.ts index 5cf9278..c637ed4 100644 --- a/client/src/api/requests.ts +++ b/client/src/api/requests.ts @@ -10,7 +10,7 @@ else if(process.env.NEXT_PUBLIC_ENVIRONMENT == 'development'){ baseURL= 'http://localhost:80'; } else if(process.env.NEXT_PUBLIC_ENVIRONMENT == 'prod'){ - baseURL= 'http://localhost:8080'; + baseURL= 'http://4.182.131.77'; } console.log(baseURL); @@ -179,7 +179,7 @@ export const deleteJourneysForUser = (username:string, token: string) => { Authorization: 'Bearer ' + token, }; - return axios.delete(`http://skipass.api/delete-journeys-user/${username}`, {headers}).then((res) => { + return axios.delete(`${baseURL}/delete-journeys-user/${username}`, {headers}).then((res) => { return res; }); }; \ No newline at end of file diff --git a/client/src/components/atoms/PostsView/index.tsx b/client/src/components/atoms/PostsView/index.tsx index 7c54bf8..e90bef4 100644 --- a/client/src/components/atoms/PostsView/index.tsx +++ b/client/src/components/atoms/PostsView/index.tsx @@ -34,7 +34,6 @@ const PostsView = (props:Props) => { setExpandedId(postId); if(journeyId !== 0){ const res = await viewJourney(journeyId); - console.log(res); if (res.data){ setJourney(res.data); } @@ -70,7 +69,6 @@ const PostsView = (props:Props) => { props.setTrigger(!props.trigger); }) .catch((e)=>{ - console.log(e); if(e.response.status === 401){ // @ts-ignore loginWithRedirect(); @@ -80,7 +78,7 @@ const PostsView = (props:Props) => { const reaction = selected[0].reactions?.filter((x)=>x.creator === user?.nickname && x.postId === postId ); await deleteReaction(reaction[0].id, token).then(()=>{ props.setTrigger(!props.trigger); - }).catch((e)=>{console.log(e);}); + }).catch(()=>{}); } }; diff --git a/client/src/components/atoms/UserPostsView/index.tsx b/client/src/components/atoms/UserPostsView/index.tsx index bdfd713..e7fef2b 100644 --- a/client/src/components/atoms/UserPostsView/index.tsx +++ b/client/src/components/atoms/UserPostsView/index.tsx @@ -86,7 +86,6 @@ const UserPostsView = (props:Props) => { await deletePost(data, token).then(()=>{ props.setTrigger(!props.trigger); }).catch((e)=>{ - console.log(e); if(e.response.status === 401){ // @ts-ignore loginWithRedirect(); @@ -119,7 +118,6 @@ const UserPostsView = (props:Props) => { props.setTrigger(!props.trigger); setEditing(false); }).catch((e)=>{ - console.log(e); if(e.response.status === 401){ // @ts-ignore diff --git a/client/src/pages/index.tsx b/client/src/pages/index.tsx index f880e62..07d1853 100644 --- a/client/src/pages/index.tsx +++ b/client/src/pages/index.tsx @@ -43,7 +43,7 @@ const HomePage = () => { return ( <> - {isAuthenticated && + {isAuthenticated ? { }} > Welcome {user!.nickname}! - } + + :} {posts.length == 0 ? { aria-describedby="modal-modal-description" > - + Are you sure that you want to delete all of your journeys?. This action can not be undone. - - + + { aria-describedby="modal-modal-description" > - + Are you sure that you want to delete all of your likes? This action can not be undone. - - + + { aria-describedby="modal-modal-description" > - + Are you sure that you want to delete all of your posts? This action can not be undone. - - + +