import { HttpClient } from '@angular/common/http';
import { inject, Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class PrijaveService {

  constructor() { }

  url = 'http://localhost:8080/prijave';

  http = inject(HttpClient)

  postojiPrijava(korisnicko_ime: string, aktivnostId: number) {
    return this.http.get<boolean>(`${this.url}/dohvati/${korisnicko_ime}/${aktivnostId}`);
  }

  prijaviSe(korisnicko_ime: string, aktivnostId: number, brSale: number) {
    return this.http.post<boolean>(`${this.url}/prijaviAktivnost/${korisnicko_ime}/${aktivnostId}/${brSale}`, null);
  }
}
