Subscribe au bon endroit pour un refresh
correct de la liste des infos.
This commit is contained in:
@@ -31,8 +31,10 @@ export class NewAircraftComponent implements OnInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.serviceApi.AddAircraft(formData.aircraftName, this.selectedFile);
|
this.serviceApi.AddAircraft(formData.aircraftName, this.selectedFile)
|
||||||
this.serviceComm.RefreshData(AddAction.Aircraft);
|
.subscribe(() => {
|
||||||
|
this.serviceComm.RefreshData(AddAction.Aircraft);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public onFileChanged(fileInput: any) {
|
public onFileChanged(fileInput: any) {
|
||||||
|
|||||||
@@ -49,16 +49,16 @@ export class NewDropZoneComponent implements OnInit {
|
|||||||
dzType.push("tunnel");
|
dzType.push("tunnel");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dropzoneService.AddDropZone(
|
this.dropzoneService.AddDropZone(splitGps[0],
|
||||||
splitGps[0],
|
splitGps[1],
|
||||||
splitGps[1],
|
formData.dzName,
|
||||||
formData.dzName,
|
formData.address,
|
||||||
formData.address,
|
formData.website,
|
||||||
formData.website,
|
formData.contactMail,
|
||||||
formData.contactMail,
|
dzType,
|
||||||
dzType,
|
false)
|
||||||
false
|
.subscribe(() => {
|
||||||
);
|
this.serviceComm.RefreshData(AddAction.Dropzone);
|
||||||
this.serviceComm.RefreshData(AddAction.Dropzone);
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export class NewGearComponent implements OnInit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {}
|
ngOnInit() { }
|
||||||
|
|
||||||
onSubmit(formData) {
|
onSubmit(formData) {
|
||||||
this.serviceApi.AddGear(formData.name,
|
this.serviceApi.AddGear(formData.name,
|
||||||
@@ -56,8 +56,9 @@ export class NewGearComponent implements OnInit {
|
|||||||
+formData.maxSize,
|
+formData.maxSize,
|
||||||
formData.aad,
|
formData.aad,
|
||||||
formData.mainCanopy,
|
formData.mainCanopy,
|
||||||
formData.reserveCanopy
|
formData.reserveCanopy)
|
||||||
);
|
.subscribe(() => {
|
||||||
this.serviceComm.RefreshData(AddAction.Gear);
|
this.serviceComm.RefreshData(AddAction.Gear);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export class NewJumpTypeComponent implements OnInit {
|
|||||||
public addForm: FormGroup;
|
public addForm: FormGroup;
|
||||||
|
|
||||||
constructor(private serviceComm: ServiceComm,
|
constructor(private serviceComm: ServiceComm,
|
||||||
private jumpTypeService: JumpTypeService) {
|
private jumpTypeService: JumpTypeService) {
|
||||||
this.addForm = new FormGroup(
|
this.addForm = new FormGroup(
|
||||||
{
|
{
|
||||||
jumptypeName: new FormControl("", Validators.required)
|
jumptypeName: new FormControl("", Validators.required)
|
||||||
@@ -22,10 +22,12 @@ export class NewJumpTypeComponent implements OnInit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {}
|
ngOnInit() { }
|
||||||
|
|
||||||
onSubmit(formData) {
|
onSubmit(formData) {
|
||||||
this.jumpTypeService.AddJumpType(formData.jumptypeName);
|
this.jumpTypeService.AddJumpType(formData.jumptypeName)
|
||||||
this.serviceComm.RefreshData(AddAction.JumpType);
|
.subscribe(() => {
|
||||||
|
this.serviceComm.RefreshData(AddAction.JumpType);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,9 +25,8 @@ export class AircraftService extends BaseService {
|
|||||||
imageData: dataImg
|
imageData: dataImg
|
||||||
};
|
};
|
||||||
|
|
||||||
this.http.post(`${this.apiUrl}/Aircraft`,
|
return this.http.post(`${this.apiUrl}/Aircraft`,
|
||||||
bodyNewAircraft,
|
bodyNewAircraft,
|
||||||
{ headers: this.headers })
|
{ headers: this.headers });
|
||||||
.subscribe(data => console.log(data));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export class DropzoneService extends BaseService {
|
|||||||
this.http.put(`${this.apiUrl}/DropZone/AddToFavorite/${selectedDz.id}`,
|
this.http.put(`${this.apiUrl}/DropZone/AddToFavorite/${selectedDz.id}`,
|
||||||
selectedDz,
|
selectedDz,
|
||||||
{ headers: this.headers })
|
{ headers: this.headers })
|
||||||
.subscribe(data => console.log(data));
|
.subscribe();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ export class DropzoneService extends BaseService {
|
|||||||
this.http.put(`${this.apiUrl}/DropZone/RemoveToFavorite${selectedDz.id}`,
|
this.http.put(`${this.apiUrl}/DropZone/RemoveToFavorite${selectedDz.id}`,
|
||||||
selectedDz,
|
selectedDz,
|
||||||
{ headers: this.headers })
|
{ headers: this.headers })
|
||||||
.subscribe(data => console.log(data));
|
.subscribe();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -64,9 +64,8 @@ export class DropzoneService extends BaseService {
|
|||||||
isFavorite: isFavorite
|
isFavorite: isFavorite
|
||||||
};
|
};
|
||||||
|
|
||||||
this.http.post(`${this.apiUrl}/DropZone`,
|
return this.http.post(`${this.apiUrl}/DropZone`,
|
||||||
bodyNewDropZone,
|
bodyNewDropZone,
|
||||||
{ headers: this.headers })
|
{ headers: this.headers });
|
||||||
.subscribe(data => console.log(data));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ export class GearService extends BaseService {
|
|||||||
reserveCanopy: reserveCanopy
|
reserveCanopy: reserveCanopy
|
||||||
};
|
};
|
||||||
|
|
||||||
this.http.post(`${this.apiUrl}/Gear`, bodyNewGear, { headers: this.headers})
|
return this.http.post(`${this.apiUrl}/Gear`, bodyNewGear, { headers: this.headers});
|
||||||
.subscribe(data => console.log(data));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,9 +24,8 @@ export class JumpTypeService extends BaseService {
|
|||||||
name: jumptypetName
|
name: jumptypetName
|
||||||
};
|
};
|
||||||
|
|
||||||
this.http.post(`${this.apiUrl}/JumpType`,
|
return this.http.post(`${this.apiUrl}/JumpType`,
|
||||||
bodyJumpType,
|
bodyJumpType,
|
||||||
{ headers: this.headers })
|
{ headers: this.headers });
|
||||||
.subscribe(data => console.log(data));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user