@@ -3,6 +3,7 @@ import { HttpClient, HttpParams } from '@angular/common/http';
33import { Observable } from 'rxjs' ;
44import {
55 CharacterSearchResult ,
6+ PvpTeam ,
67 XivapiCharacterOptions ,
78 XivapiEndpoint ,
89 XivapiList ,
@@ -31,8 +32,8 @@ export class XivapiService {
3132 * @param id The id of the resource for the request.
3233 * @param options The options of the request, optional.
3334 */
34- public get ( endpoint : XivapiEndpoint , id : number , options ?: XivapiRequestOptions ) : Observable < any > {
35- return this . request < any > ( `${ XivapiService . API_BASE_URL } /${ endpoint } /${ id } ` , options ) ;
35+ public get < T = any > ( endpoint : XivapiEndpoint , id : number , options ?: XivapiRequestOptions ) : Observable < T > {
36+ return this . request < T > ( `${ XivapiService . API_BASE_URL } /${ endpoint } /${ id } ` , options ) ;
3637 }
3738
3839 /**
@@ -41,8 +42,8 @@ export class XivapiService {
4142 * @param endpoint The endpoint to use for the request.
4243 * @param options The options of the request, optional.
4344 */
44- public getList ( endpoint : XivapiEndpoint , options ?: XivapiRequestOptions ) : Observable < XivapiList < any > > {
45- return this . request < XivapiList < any > > ( `${ XivapiService . API_BASE_URL } /${ endpoint } ` , options ) ;
45+ public getList < T = any > ( endpoint : XivapiEndpoint , options ?: XivapiRequestOptions ) : Observable < XivapiList < T > > {
46+ return this . request < XivapiList < T > > ( `${ XivapiService . API_BASE_URL } /${ endpoint } ` , options ) ;
4647 }
4748
4849 /**
@@ -138,6 +139,15 @@ export class XivapiService {
138139 return this . request < any > ( `${ XivapiService . API_BASE_URL } /Linkshell/${ lodestoneId } ${ details ? '/' + details : '' } ` , options ) ;
139140 }
140141
142+ /**
143+ * Gets a PvP team based on its lodestone id (string)
144+ *
145+ * @param id the id of the team to get.
146+ */
147+ public getPvPTeam ( id : string ) : Observable < PvpTeam > {
148+ return this . request < PvpTeam > ( `${ XivapiService . API_BASE_URL } /PvPTeam/${ id } ` ) ;
149+ }
150+
141151 /**
142152 * Gets the list of patches using the /PatchList endpoint.
143153 * @param options Options of the request.
0 commit comments