import { APIBase } from '@dvn/core/api/apiBase';
export class UyeApiImpl {
  constructor(endpoint, defaultHeaders = {}) {
    this.getMembershipConfig = (id) => this.api.get(`memberships/${id}`);
    this.getMembershipConfigWithName = (name) => this.api.get(`memberships`, { name });
    this.activateMembership = (membershipConfigId, membershipId) => this.api.post(`${membershipConfigId}/${membershipId}/activate`, {});
    this.getMembership = (id) => this.api.get(`memberships/${id}`);
    this.getMembershipsOfUser = (userId) => this.api.get(`memberships`, { userId });
    this.updateMembership = (membershipConfigId, membershipId, data) => this.api.put(`${membershipConfigId}/${membershipId}`, data);
    this.getAgreement = (id) => this.api.get(`agreements/${id}`);
    this.consentAgreement = (id) => this.api.post(`agreements/${id}`, {});
    this.addAuthInterceptor = (token) => {
      this.api.addAuthInterceptor(token);
    };
    this.api = new APIBase(endpoint, defaultHeaders);
  }
  getAppConfigOfMembership(id) {
    console.log(id);
    return Promise.resolve(undefined);
  }
}
