Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with marketplace endpoint #1523

Merged
merged 2 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/home/products/DynamicCategoryCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ArrowCircleLeft, ArrowCircleRight } from 'iconsax-react';
import shopOne from '../../../public/assets/home/shopOne.webp';
import shopTwo from '../../../public/assets/home/shopTwo.webp';
import { useQuery } from '@tanstack/react-query';
import { MARKETPLACE_API_URL } from '@modules/marketplace/http';

interface Slide {
src?: string;
Expand Down Expand Up @@ -76,7 +77,7 @@ const DynamicCategoryCarousel = () => {
} = useQuery(
['categoryNames'],
async () => {
const response = await axios.get('https://staging.zuri.team/api/marketplace/v1/category-name/');
const response = await axios.get(`${MARKETPLACE_API_URL}/category-name/`);
return response?.data?.data?.slice(0, 12);
},
{
Expand Down
2 changes: 1 addition & 1 deletion modules/marketplace/http/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios';
export const MARKETPLACE_API_URL = process.env.NEXT_PUBLIC_MARKETPLACE_API_URL || "https://zuri-marketplace-backend.onrender.com/api/marketplace/v1/"
export const MARKETPLACE_API_URL = process.env.NEXT_PUBLIC_MARKETPLACE_API_URL || "https://zuri-marketplace-backend.onrender.com/api/marketplace/v1"


const http = axios.create({
Expand Down
2 changes: 1 addition & 1 deletion pages/marketplace/categories/[category]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const getServerSideProps = async (context: any) => {
}

try {
const res = await http.get('category-name/');
const res = await http.get('/category-name/');
const isCategoryAvailable = res.data?.data.filter((el: any) => el.name === category);

if (isCategoryAvailable.length === 0) {
Expand Down