{ "version": 3, "sources": ["src/app/features/thematics/services/thematiques.service.ts"], "sourcesContent": ["import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Cause } from '@features/causes/causes.models';\nimport { Thematic, ThematicMedia } from '@features/thematics/thematics.models';\nimport { environment } from 'environments/environment';\nimport { forkJoin, map, Observable } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ThematicsService {\n private readonly api = `${environment.adventureUri}/thematics`;\n\n constructor(private http: HttpClient) {}\n\n public getThematicAll(thematicUuid: string): Observable<Thematic> {\n const thematic$ = this.getThematic(thematicUuid);\n const causes$ = this.getCausesThematiques(thematicUuid);\n const medias$ = this.getMedias(thematicUuid);\n\n return forkJoin([thematic$, causes$, medias$]).pipe(\n map(([thematic, causes, medias]) => ({\n ...thematic,\n causes,\n medias\n }))\n );\n }\n\n public getThematicsCauses(): Observable<Thematic[]> {\n return this.http.get<Thematic[]>(`${this.api}/causes`);\n }\n\n public getCausesThematiques(thematicUuid: string): Observable<Cause[]> {\n return this.http.get<Cause[]>(`${this.api}/${thematicUuid}/causes/thematic-membership`);\n }\n\n private getThematic(thematicUuid: string): Observable<Thematic> {\n return this.http.get<Thematic>(`${this.api}/${thematicUuid}`);\n }\n\n private getMedias(thematicUuid: string): Observable<ThematicMedia[]> {\n return this.http.get<ThematicMedia[]>(`${this.api}/${thematicUuid}/medias`);\n }\n}\n"], "mappings": ";;;;;;;;;;;;;;AAUM,IAAO,oBAAP,MAAO,kBAAgB;EAG3B,YAAoB,MAAgB;AAAhB,SAAA,OAAA;AAFH,SAAA,MAAM,GAAG,YAAY,YAAY;EAEX;EAEhC,eAAe,cAAoB;AACxC,UAAM,YAAY,KAAK,YAAY,YAAY;AAC/C,UAAM,UAAU,KAAK,qBAAqB,YAAY;AACtD,UAAM,UAAU,KAAK,UAAU,YAAY;AAE3C,WAAO,SAAS,CAAC,WAAW,SAAS,OAAO,CAAC,EAAE,KAC7C,IAAI,CAAC,CAAC,UAAU,QAAQ,MAAM,MAAO,iCAChC,WADgC;MAEnC;MACA;MACA,CAAC;EAEP;EAEO,qBAAkB;AACvB,WAAO,KAAK,KAAK,IAAgB,GAAG,KAAK,GAAG,SAAS;EACvD;EAEO,qBAAqB,cAAoB;AAC9C,WAAO,KAAK,KAAK,IAAa,GAAG,KAAK,GAAG,IAAI,YAAY,6BAA6B;EACxF;EAEQ,YAAY,cAAoB;AACtC,WAAO,KAAK,KAAK,IAAc,GAAG,KAAK,GAAG,IAAI,YAAY,EAAE;EAC9D;EAEQ,UAAU,cAAoB;AACpC,WAAO,KAAK,KAAK,IAAqB,GAAG,KAAK,GAAG,IAAI,YAAY,SAAS;EAC5E;;;yBAjCW,mBAAgB,mBAAA,UAAA,CAAA;AAAA;qFAAhB,mBAAgB,SAAhB,kBAAgB,WAAA,YAFf,OAAM,CAAA;AAEd,IAAO,mBAAP;", "names": [] }