/* eslint-disable @typescript-eslint/no-explicit-any */
"use serve"
import axiosInstance from "@/lib/constant";
import { GalleryInput, UpdateGalleryInput } from "./type";
import { AxiosResponse } from "axios";

export const getGalleres = () => {
   return axiosInstance.get(`gallery/all`);
}


export const geOneGallery = (galleryId: number) => {
   return axiosInstance.get(`gallery/view?g=${galleryId}`);
}

export const createGallery = async (body: GalleryInput): Promise<AxiosResponse<GalleryInput, any>> => {
   return await axiosInstance.post<GalleryInput>('/gallery/add', body);
};


export const updateGallery = async (body: UpdateGalleryInput): Promise<AxiosResponse<UpdateGalleryInput, any>> => {
   return await axiosInstance.post<UpdateGalleryInput>('/gallery/update', body);
};


