import { baseAPI } from '@/shared/api/base-api';

import { ReviewFormValues } from '../model/review-form.schema';

export const reviewsAPI = baseAPI.injectEndpoints({
  endpoints: (build) => ({
    createReview: build.mutation<void, ReviewFormValues>({
      query: (body) => ({
        url: 'reviews/create',
        method: 'POST',
        body,
      }),
    }),
  }),
});

export const { useCreateReviewMutation } = reviewsAPI;
