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

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


export const geOneStory = (storyId: number) => {
   return axiosInstance.get(`story/view?s=${storyId}`);
}

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


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


