working updates
This commit is contained in:
@@ -15,14 +15,50 @@ const httpOptionsPut = {
|
||||
@Injectable()
|
||||
export class GamesService {
|
||||
|
||||
APIURL = "http://www.lazypug.net/api.php";
|
||||
APIURL = "http://192.241.155.78/ludosdata/api.php";
|
||||
|
||||
constructor(
|
||||
private http: HttpClient
|
||||
){ }
|
||||
|
||||
getGames( queryFilters, querryPage, queryOrder ): Observable<any> {
|
||||
return this.http.get( this.APIURL + "/games?filter="+ queryFilters +"&page="+ querryPage +"&order="+ queryOrder +"&transform=1" )
|
||||
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 => {
|
||||
return(
|
||||
res
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
postGame( gameData ): Observable<any> {
|
||||
return this.http.post( this.APIURL + "/games/", gameData, httpOptions )
|
||||
.map(res => {
|
||||
return(
|
||||
res
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
getGameById( gameId ): Observable<any> {
|
||||
return this.http.get( this.APIURL + "/games/" + gameId )
|
||||
.map(res => {
|
||||
return(
|
||||
res
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
putGameById( gameData, gameId ): Observable<any> {
|
||||
return this.http.get( this.APIURL + "/games/" + gameId )
|
||||
.map(res => {
|
||||
return(
|
||||
res
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
deleteGameById( gameId ): Observable<any> {
|
||||
return this.http.get( this.APIURL + "/games/" + gameId )
|
||||
.map(res => {
|
||||
return(
|
||||
res
|
||||
|
||||
Reference in New Issue
Block a user