import { DataModel } from '@dvn/core/models/data-model';
export class MentornityAnnouncementPublishBridgeApi {
  constructor(selectedUsers) {
    this.selectedUsers = selectedUsers;
  }
  addAuthInterceptor(_token) {
    // console.log('MBA.addAuthInterceptor', token);
  }
  // region DataApi
  get(_collection, _id, _query) {
    return undefined;
  }
  query() {
    return new Promise((resolve => {
      resolve({
        results: this.selectedUsers.map((item) => DataModel.decode(Object.assign({ _id: item._id }, (item || {})))),
        meta: {
          total: this.selectedUsers.length,
        }
      });
    }));
  }
  getRoleForFetching(role) {
    if (role === 'mentorsCustom') {
      return 'mentors';
    }
    else if (role === 'menteesCustom') {
      return 'mentees';
    }
    else {
      return role;
    }
  }
  update(_collection, _id, _body) {
    return undefined;
  }
}
