import request from '@/utils/request';
import type { LoginResult, RegisterParams } from '@/types/auth';

export const login = (data: any) => {
    return request.post<any, LoginResult>('/auth/login', data);
};

export const register = (data: RegisterParams) => {
    return request.post('/auth/register', data);
};

export const getUserInfo = () => {
    return request.get('/auth/me');
};

export const logout = () => {
    // Client-side logout usually, but if there's a backend endpoint:
    // return request.post('/auth/logout');
    return Promise.resolve();
};
