/* eslint-disable @typescript-eslint/no-explicit-any */
import { client } from "@/lib/constant";
import { AxiosResponse } from "axios";

import axiosInstance from "@/lib/constant";
import { LoginInput, RegisterInput, UploadInput } from "./type";



export const LogIn = async (user: LoginInput): Promise<AxiosResponse<LoginInput, any>> => {
   return await client.post<LoginInput>('/user/login', user);
};


export const RegisterNow = async (user: RegisterInput): Promise<AxiosResponse<RegisterInput, any>> => {
   return await client.post<RegisterInput>('/user/register', user);
};


export const uploadFile = async (body: FormData): Promise<AxiosResponse<UploadInput, any>> => {
   return await axiosInstance.post<UploadInput>('/user/upload', body, {
      headers: { "Content-Type": "multipart/form-data" }, // Required for file upload
   });
};








