Update to retrieve the jumps page by page.

This commit is contained in:
Sébastien André
2022-05-08 16:42:54 +02:00
parent 9e18b7708a
commit bc1edca944
5 changed files with 98 additions and 59 deletions

View File

@@ -5,6 +5,7 @@ import { forkJoin, Observable, of } from "rxjs";
import { map } from "rxjs/operators";
import { JumpResp, JumpReq, Jump } from "../models/jump";
import { JumpListResp, JumpList } from "../models/jumpList";
import { GearResp } from "../models/gear";
import { DropZoneResp } from "../models/dropzone";
import { AircraftResp } from "../models/aircraft";
@@ -39,6 +40,19 @@ export class JumpService extends BaseService {
}));
}
public GetJumps(beginIndex: number, endIndex: number): Observable<JumpList> {
return this.http.get<JumpListResp>(`${this.apiUrl}/Jump/${beginIndex}/${endIndex}`,
{ headers: this.headers })
.pipe(map((response) => {
let result: JumpList = {
rows : this.MapWithDataInCache(response.rows),
count : response.count
};
return new JumpList(result);
}));
}
public AddListOfJump(selectedJumpType: number,
selectedAircraft: number,
selectedDz: number,