import { User } from '@/data/user/user.model';
import { CommonResponseType } from '@/helpers/types';
import { request } from '@/services/request';

export const user_requests = {
    async getMe() {
        return request.get<CommonResponseType<User>>('/users/info');
    },

    async login(body: { username: string; password: string }) {
        return request.post<
            CommonResponseType<{
                username: string;
                accessToken: string;
                roles: string[];
            }>
        >('/auth/token', body);
    },
};
