Modification de la récupération des sauts et mapping entre les IDs des données référentielles et les données présentes dans le cache.
This commit is contained in:
@@ -8,12 +8,20 @@ import { JumpResp, JumpReq } from "../models/jump";
|
||||
|
||||
import { DateService } from "./date.service";
|
||||
import { BaseService } from "./base.service";
|
||||
import { DropzoneService } from "./dropzone.service";
|
||||
import { AircraftService } from "./aircraft.service";
|
||||
import { JumpTypeService } from "./jump-type.service";
|
||||
import { GearService } from "./gear.service";
|
||||
|
||||
@Injectable()
|
||||
export class JumpService extends BaseService {
|
||||
constructor(private http: HttpClient,
|
||||
private dateService: DateService,
|
||||
private datePipe: DatePipe) {
|
||||
private datePipe: DatePipe,
|
||||
private dropzoneService: DropzoneService,
|
||||
private aircraftService: AircraftService,
|
||||
private jumpTypeService: JumpTypeService,
|
||||
private gearService: GearService,) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -22,7 +30,15 @@ export class JumpService extends BaseService {
|
||||
{ headers: this.headers })
|
||||
.pipe(
|
||||
map((response) => {
|
||||
const details = response.map((data) => new JumpResp(data));
|
||||
let details = response.map((data) =>
|
||||
{
|
||||
let t = new JumpResp(data);
|
||||
this.dropzoneService.getById(t.dropZoneId).subscribe((d)=> t.dropZone = d );
|
||||
this.aircraftService.getById(t.aircraftId).subscribe((d)=> t.aircraft = d );
|
||||
this.jumpTypeService.getById(t.jumpTypeId).subscribe((d)=> t.jumpType = d );
|
||||
this.gearService.getById(t.gearId).subscribe((d)=> t.gear = d );
|
||||
return t;
|
||||
});
|
||||
return details;
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user