add comments
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user