add comments

This commit is contained in:
hamid zarghami
2025-09-07 15:37:00 +03:30
parent 42e5966e32
commit 554312ddc6
11 changed files with 460 additions and 12 deletions
+9
View File
@@ -1,5 +1,6 @@
import axios from "@/config/axios";
import { ProductDetailResponse } from "@/types/product.types";
import { AddCommentProps } from "../types/Types";
export const getProduct = async (
id: string
@@ -7,3 +8,11 @@ export const getProduct = async (
const { data } = await axios.get(`/product/${id}`);
return data;
};
export const addComment = async (params: AddCommentProps) => {
const { data } = await axios.post(
`/product/${params.productId}/comments`,
params
);
return data;
};