business page
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
import GridWrapper from "@/components/GridWrapper";
|
import GridWrapper from "@/components/GridWrapper";
|
||||||
|
import CatalogueGridSkeleton from "@/pages/catalogue/components/CatalogueGridSkeleton";
|
||||||
|
import CatalogueItem from "@/pages/catalogue/components/CatalogueItem";
|
||||||
import { type FC } from "react";
|
import { type FC } from "react";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import CatalogueGridSkeleton from "./components/CatalogueGridSkeleton";
|
import { useGetBusinessCatalog } from "./hooks/useBusinessData";
|
||||||
import CatalogueItem from "./components/CatalogueItem";
|
|
||||||
import { useGetBusinessCatalog } from "./hooks/useCatalogueData";
|
|
||||||
|
|
||||||
const Business: FC = () => {
|
const Business: FC = () => {
|
||||||
const { slug } = useParams<{ slug: string }>();
|
const { slug } = useParams<{ slug: string }>();
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
import * as api from "../service/BusinessService";
|
||||||
|
|
||||||
|
export const useGetBusinessCatalog = (slug: string) => {
|
||||||
|
return useQuery({
|
||||||
|
queryKey: ["businessCatalog", slug],
|
||||||
|
queryFn: () => api.getBusinessCatalog(slug),
|
||||||
|
enabled: !!slug,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const useGetBusinessBySlug = (slug: string) => {
|
||||||
|
return useQuery({
|
||||||
|
queryKey: ["business", slug],
|
||||||
|
queryFn: () => api.getBusinessBySlug(slug),
|
||||||
|
enabled: !!slug,
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import axios from "@/config/axios";
|
||||||
|
import type { CatalogResponseType } from "@/pages/catalogue/types/Types";
|
||||||
|
|
||||||
|
export const getBusinessCatalog = async (slug: string) => {
|
||||||
|
const { data } = await axios.get<CatalogResponseType>(
|
||||||
|
`/public/catalogue/business/slug/${slug}`,
|
||||||
|
);
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getBusinessBySlug = async (slug: string) => {
|
||||||
|
const { data } = await axios.get(`/public/business/${slug}`);
|
||||||
|
return data;
|
||||||
|
};
|
||||||
@@ -127,19 +127,3 @@ export const usePurchaseInitate = () => {
|
|||||||
mutationFn: api.purchaseInitate,
|
mutationFn: api.purchaseInitate,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useGetBusinessCatalog = (slug: string) => {
|
|
||||||
return useQuery({
|
|
||||||
queryKey: ["businessCatalog", slug],
|
|
||||||
queryFn: () => api.getBusinessCatalog(slug),
|
|
||||||
enabled: !!slug,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const useGetBusinessBySlug = (slug: string) => {
|
|
||||||
return useQuery({
|
|
||||||
queryKey: ["business", slug],
|
|
||||||
queryFn: () => api.getBusinessBySlug(slug),
|
|
||||||
enabled: !!slug,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -50,15 +50,3 @@ export const purchaseInitate = async (params: PurchaseInitiate) => {
|
|||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getBusinessCatalog = async (slug: string) => {
|
|
||||||
const { data } = await axios.get<CatalogResponseType>(
|
|
||||||
`/public/catalogue/business/slug/${slug}`,
|
|
||||||
);
|
|
||||||
return data;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getBusinessBySlug = async (slug: string) => {
|
|
||||||
const { data } = await axios.get(`/public/business/${slug}`);
|
|
||||||
return data;
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { isBusinessCatalogPath, isViewerPath, Paths } from "@/config/Paths";
|
import { isBusinessCatalogPath, isViewerPath, Paths } from "@/config/Paths";
|
||||||
import { clx } from "@/helpers/utils";
|
import { clx } from "@/helpers/utils";
|
||||||
import Business from "@/pages/catalogue/Business";
|
import Business from "@/pages/business/Business";
|
||||||
import CatalogueList from "@/pages/catalogue/List";
|
import CatalogueList from "@/pages/catalogue/List";
|
||||||
import DesignerRequest from "@/pages/designer/Request";
|
import DesignerRequest from "@/pages/designer/Request";
|
||||||
import Editor from "@/pages/editor/Editor";
|
import Editor from "@/pages/editor/Editor";
|
||||||
|
|||||||
Reference in New Issue
Block a user