Skip to content

Commit

Permalink
Merge pull request #1527 from hngx-org/bug-fixes
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
Homoakin619 authored Dec 12, 2023
2 parents c08ca1a + 983b4aa commit 78fa9d6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion http/auth.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from 'axios';

const AUTH_HTTP_URL = 'https://zuri-auth.up.railway.app/api/v1';
export const AUTH_HTTP_URL = 'https://zuri-auth.up.railway.app/api/v1';

const $http = axios.create({
baseURL: AUTH_HTTP_URL,
Expand Down
8 changes: 4 additions & 4 deletions http/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { MARKETPLACE_API_URL } from '@modules/marketplace/http';
import { CartItemProps } from '../@types';
import $http from './axios';
import axios from 'axios';
import { AUTH_HTTP_URL } from './auth';



Expand All @@ -10,7 +11,6 @@ import axios from 'axios';
export const STAGING_URL = process.env.NEXT_PUBLIC_APP_STAGING_URL || 'https://staging.zuri.team';
export const API_BASE_URL = process.env.NEXT_PUBLIC_BACKEND_ENDPOINT_URL || 'https://zuriportfolio-backend.onrender.com/api/v1'
export const RECENTLY_VIEWED_ENDPOINT = 'https://staging.zuri.team/api/marketplace/v1/recently-viewed';
export const AUTH_API_ENDPOINT = "https://zuri-auth.up.railway.app/api/auth/api"
export const CART_ENDPOINT = API_BASE_URL + "/checkout";


Expand Down Expand Up @@ -64,10 +64,10 @@ export const removeFromCart = async (productId: string, token: string) => {
throw error;
}
};
// https://zuri-auth.up.railway.app/api/auth/api/

export const createTempUser = async (datas: { email: string; firstName: string; lastName: string }) => {
try {
const apiUrl = 'https://zuri-auth.up.railway.app/api/auth/api/auth/signup-guest';
const apiUrl = `${AUTH_HTTP_URL}/auth/signup-guest`;
const response = await $http.post(apiUrl, datas);
return response.data;
} catch (error) {
Expand Down Expand Up @@ -143,7 +143,7 @@ export const makePayment = async (selectedPaymentMethod: string, token: string)

const getTokenDetails = async (token: string) => {
try {
const response = await $http.post(`${AUTH_API_ENDPOINT}/authorize`, { token });
const response = await $http.post(`${AUTH_HTTP_URL}/authorize`, { token });
return response.data;
} catch (error) {
return error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import React from 'react';
import Image from 'next/image';
import SignUpWithSocialsButton from './SignUpWithSocialsButton';
import facebookLogo from '../../../../public/assets/images/logo/facebook-logo.svg';
import { AUTH_HTTP_URL } from '../../../../http/auth';

const SignUpWithFacebook = () => {
return (
<SignUpWithSocialsButton
onClick={function (): void {
throw new Error('Function not implemented.');
}}
href="https://zuri-auth.up.railway.app/api/auth/api/auth/facebook"
href={`${AUTH_HTTP_URL}/auth/facebook`}
leftIcon={<Image src={facebookLogo} alt="Facebook Logo" className="w-5 h-5" />}
>
Continue with Facebook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import React from 'react';
import Image from 'next/image';
import SignUpWithSocialsButton from './SignUpWithSocialsButton';
import githubLogo from '../../../../public/assets/images/logo/github-logo.svg';
import { AUTH_HTTP_URL } from '../../../../http/auth';
const SignUpWithGithub = () => {
return (
<SignUpWithSocialsButton
onClick={function (): void {
throw new Error('Function not implemented.');
}}
href="https://zuri-auth.up.railway.app/api/auth/api/auth/github"
href={`${AUTH_HTTP_URL}/auth/github`}
leftIcon={<Image src={githubLogo} alt="GitHub logo" className="w-5 h-5" />}
>
Continue with Github
Expand Down
6 changes: 3 additions & 3 deletions modules/auth/component/AuthSocialButtons/SignUpWithGoogle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ import Image from 'next/image';
import SignUpWithSocialsButton from './SignUpWithSocialsButton';
import googleLogo from '../../../../public/assets/Google.png';
import LogoCarousel from '@modules/home/carousel/logos/logosCarousel';
import { AUTH_HTTP_URL } from '../../../../http/auth';

const SignUpWithGoogle = () => {
const [isloading, setIsLoading] = useState(false);

const handleLinkClick = () => {
setIsLoading(true);
setTimeout(() => {
window.location.href = 'https://zuri-auth.up.railway.app/api/auth/api/auth/google';
window.location.href = `${AUTH_HTTP_URL}/auth/google`
}, 5000);
};

//href="https://zuri-auth.up.railway.app/api/auth/api/auth/google"

return (
// the google logo has white space around it, so i am reducing the margin on the right so all the buttons look similar
<SignUpWithSocialsButton
// href="https://zuri-auth.up.railway.app/api/auth/api/auth"
onClick={handleLinkClick}
isLoading={isloading}
//onClick={handleGoogleSignIn}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Input } from '@ui/Input';
import { useAuth } from '../../../../context/AuthContext';
import { notify } from '@ui/Toast';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { AUTH_HTTP_URL } from '../../../../http/auth';

interface userDetailsI {
email: string;
Expand Down Expand Up @@ -41,8 +42,8 @@ function UpdatePassword() {
const { mutate, isLoading } = useMutation(
(formData: any) => {
// This function will be called when you call the mutate function
// https://zuri-auth.up.railway.app/api/auth/api/authorize
return axios.put('https://zuri-auth.up.railway.app/api/auth/api/auth/reset-password/change', formData);

return axios.put(`${AUTH_HTTP_URL}/auth/reset-password/change`, formData);
},
{
// onSuccess callback is triggered when the mutation is successful
Expand Down

1 comment on commit 78fa9d6

@vercel
Copy link

@vercel vercel bot commented on 78fa9d6 Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zuriportfolio-frontend – ./

zuriportfolio-frontend-zuri-team.vercel.app
zuriportfolio.vercel.app
zuriportfolio-frontend-git-dev-zuri-team.vercel.app

Please sign in to comment.