import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { NewVisitor } from '../../entity/NewVisitor';
import { CrudService } from './crud.service';
import { first, map } from 'rxjs/operators';
import { HappinessBEST } from '../../entity/HappinessGroup';

const BASE_URL = (action: string = null) => { return `Best${(action ? `/${action}` : '')}` }
const GET_URL_GET_INVITATION_Q_RCODE = (id) => `Best/GetInvitationQRcode?id=${id}`;


@Injectable({
  providedIn: 'root'
})
export class BestService extends CrudService<HappinessBEST> {

  constructor(protected http: HttpClient) {
    super(http, BASE_URL);
  }
  getInvitationQRcode(id: string) {
    return this.http.get<HappinessBEST>(GET_URL_GET_INVITATION_Q_RCODE(id));
  }
}
