import { T_reviews } from '@/types/review.type';
import axiosInstance from './../axiosInstance';


export const reviewsService = {
    getReviews: () =>
        axiosInstance.get("/api/reviews"),

    getReviewById: (id: string) =>
        axiosInstance.get(`/api/reviews/${id}`),

    createReview: (data: Partial<T_reviews>) =>
        axiosInstance.post("/api/reviews", data),

    updateReview: (id: string, data: Partial<T_reviews>) =>
        axiosInstance.patch(`/api/reviews/${id}`, data),

    deleteReview: (id: string) =>
        axiosInstance.delete(`/api/reviews/${id}`),
};