import axios from "../../../config/axios";
import { CreateSliderType } from "../types/SliderTypes";

export const createSlider = async (params: CreateSliderType) => {
  const { data } = await axios.post("/sliders", params);
  return data;
};

export const getSliders = async () => {
  const { data } = await axios.get("/sliders");
  return data;
};

export const getSliderDetail = async (id: string) => {
  const { data } = await axios.get(`/sliders/${id}`);
  return data;
};

export const updateSlider = async (id: string, params: CreateSliderType) => {
  const { data } = await axios.patch(`/sliders/${id}`, params);
  return data;
};

export const deleteSlider = async (id: string) => {
  const { data } = await axios.delete(`/sliders/${id}`);
  return data;
};
