import * as O from 'fp-ts/Option';
import { BackendApiClient } from '../api-client';
export class UserApi {
  async getUserProfile() {
    return (await BackendApiClient.instance.url(`users/self`).get().json());
  }
  async getBasicProfileByEmail(email) {
    const res = await BackendApiClient.instance
      .url(`users?email=${email}`)
      .get()
      .notFound(() => null)
      .json();
    return O.fromNullable(res);
  }
}
export default new UserApi();
