Files
scouthub/scouthub-home-fe/src/app/crea-gruppo/gruppi-api.service.ts
T
2026-07-23 19:40:51 +02:00

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 });
}
}