20 lines
571 B
TypeScript
20 lines
571 B
TypeScript
import { HttpClient } from '@angular/common/http';
|
|
import { Injectable, inject } from '@angular/core';
|
|
import { Observable } from 'rxjs';
|
|
|
|
import { environment } from '../../environments/environment';
|
|
|
|
export interface CreaGruppoResponse {
|
|
orgId: string;
|
|
gruppiCreati: string[];
|
|
}
|
|
|
|
@Injectable({ providedIn: 'root' })
|
|
export class GruppiApiService {
|
|
private readonly http = inject(HttpClient);
|
|
|
|
creaGruppo(nome: string): Observable<CreaGruppoResponse> {
|
|
return this.http.post<CreaGruppoResponse>(`${environment.orgServiceApiBaseUrl}/gruppi`, { nome });
|
|
}
|
|
}
|