feat.
This commit is contained in:
@@ -21,6 +21,15 @@ export class GamesService {
|
||||
private http: HttpClient
|
||||
){ }
|
||||
|
||||
searchGamesByText( searchText ): Observable<any> {
|
||||
return this.http.get( this.APIURL + "/games?filter=Title,cs," + searchText + "&transform=1" )
|
||||
.map(res => {
|
||||
return(
|
||||
res
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
getGames( queryFilters, querryPage, queryOrder, queryRecordMax ): Observable<any> {
|
||||
return this.http.get( this.APIURL + "/games?filter="+ queryFilters +"&page="+ querryPage + "," + queryRecordMax +"&order="+ queryOrder +"&transform=1" )
|
||||
.map(res => {
|
||||
@@ -58,7 +67,7 @@ export class GamesService {
|
||||
}
|
||||
|
||||
deleteGameById( gameId ): Observable<any> {
|
||||
return this.http.get( this.APIURL + "/games/" + gameId )
|
||||
return this.http.delete( this.APIURL + "/games/" + gameId )
|
||||
.map(res => {
|
||||
return(
|
||||
res
|
||||
@@ -66,4 +75,19 @@ export class GamesService {
|
||||
});
|
||||
}
|
||||
|
||||
postFile(fileToUpload: File): Observable<boolean> {
|
||||
const endpoint = 'your-destination-url';
|
||||
const formData: FormData = new FormData();
|
||||
|
||||
formData.append('fileKey', fileToUpload, fileToUpload.name);
|
||||
return this.httpClient
|
||||
.post(endpoint, formData, { headers: yourHeadersConfig })
|
||||
.map(() => { return true; })
|
||||
.catch((e) => this.handleError(e));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user