Possibilité d'éditer un saut (sur 3 infos)

Indication d'un saut est spécial.
This commit is contained in:
Sébastien André
2021-04-21 15:18:40 +02:00
parent 69c49ab011
commit a2ea873ae3
11 changed files with 110 additions and 42 deletions

View File

@@ -24,7 +24,8 @@ export class GearService extends BaseService {
maxSize: number,
aad: string,
mainCanopy: string,
reserveCanopy: string) {
reserveCanopy: string)
{
const bodyNewGear: GearReq = {
id: 0,
name: name,

View File

@@ -17,17 +17,15 @@ export class JumpService extends BaseService {
super();
}
public getListOfJumps(): Observable<Array<JumpResp>> {
return this.http
.get<Array<JumpResp>>(`${this.apiUrl}/Jump`, {
headers: this.headers,
})
.pipe(
map((response) => {
const details = response.map((data) => new JumpResp(data));
return details;
})
);
public GetListOfJumps(): Observable<Array<JumpResp>> {
return this.http.get<Array<JumpResp>>(`${this.apiUrl}/Jump`,
{ headers: this.headers })
.pipe(
map((response) => {
const details = response.map((data) => new JumpResp(data));
return details;
})
);
}
public AddListOfJump(selectedJumpType: number,
@@ -40,7 +38,8 @@ export class JumpService extends BaseService {
defaultExitAltitude: number,
defaultDeployAltitude: number,
countOfJumps: number,
notes: string)
notes: string,
isSpecial: boolean)
{
const diffInDays = this.dateService.DiffBetweenDates(beginDate, endDate) + 1;
const countOfJumpsPerDay = Math.trunc(countOfJumps / diffInDays);
@@ -55,7 +54,8 @@ export class JumpService extends BaseService {
defaultExitAltitude,
defaultDeployAltitude,
countOfJumpsPerDay,
notes);
notes,
isSpecial);
beginDate = this.dateService.AddDays(beginDate, 1);
}
@@ -71,7 +71,8 @@ export class JumpService extends BaseService {
defaultExitAltitude,
defaultDeployAltitude,
restfJumps,
notes);
notes,
isSpecial);
}
public DeleteJump(item: JumpResp) {
@@ -80,6 +81,23 @@ export class JumpService extends BaseService {
.subscribe((data) => console.log(data));
}
public UpdateJump(id: number,
isSpecial: boolean,
withCutaway: boolean,
notes: string) {
const jumpData = {
id: id,
isSpecial: isSpecial,
withCutaway: withCutaway,
notes: notes
};
const bodyUpdatedJump = new JumpReq(jumpData);
return this.http.put(`${this.apiUrl}/Jump/${id}`,
bodyUpdatedJump,
{ headers: this.headers, });
}
private AddJumps(selectedJumpType: number,
selectedAircraft: number,
selectedDz: number,
@@ -89,7 +107,8 @@ export class JumpService extends BaseService {
defaultExitAltitude: number,
defaultDeployAltitude: number,
countOfJumps: number,
notes: string)
notes: string,
isSpecial: boolean)
{
for (let i = 0; i < countOfJumps; i++) {
const bodyNewjump: JumpReq = {
@@ -102,7 +121,8 @@ export class JumpService extends BaseService {
gearId: selectedRig,
notes: notes,
id: 0,
jumpDate: this.datePipe.transform(jumpDate, "yyyy-MM-dd")
jumpDate: this.datePipe.transform(jumpDate, "yyyy-MM-dd"),
isSpecial: isSpecial
};
this.http.post(`${this.apiUrl}/Jump`,