import BaseAPI from "./baseApi.js";
import RestClient from "./restClient.js";

class User extends BaseAPI {
  constructor() {
    super({ url: "/user" });
  }

  async login(username, password) {
    const response = await RestClient.post("/user/login", {
      username,
      password,
    });
    return response.data;
  }

  async me() {
    const response = await RestClient.get("/user/me");
    return response.data;
  }
}
export const UserApi = new User();
