import { ModelProfile, ModelUserForm, ModelProfileForm } from "@/types" import { fetcher, FetcherMethod } from "./api" export const getProfile = async (): Promise => { return fetcher(FetcherMethod.GET, '/api/v1/profile', null); } export const login = async (username: string, password: string): Promise => { return fetcher(FetcherMethod.POST, '/api/v1/login', { username, password }); } export const createUser = async (data: ModelUserForm): Promise => { return fetcher(FetcherMethod.POST, '/api/v1/user', data); } export const deleteUser = async (id: number[]): Promise => { return fetcher(FetcherMethod.POST, '/api/v1/batch-delete/user', id); } export const updateProfile = async (data: ModelProfileForm): Promise => { return fetcher(FetcherMethod.POST, '/api/v1/profile', data); }