⚡ Minor optimizations
This commit is contained in:
parent
550b7ac328
commit
e5a44af210
@ -41,8 +41,8 @@ export class TripCreateModalComponent {
|
|||||||
image_id: null,
|
image_id: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.config.data) {
|
const patchValue = this.config.data?.trip;
|
||||||
let patchValue = this.config.data.trip;
|
if (patchValue) {
|
||||||
if (!patchValue.image_id) delete patchValue["image"];
|
if (!patchValue.image_id) delete patchValue["image"];
|
||||||
this.tripForm.patchValue(patchValue);
|
this.tripForm.patchValue(patchValue);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,9 +43,9 @@ export class TripPlaceSelectModalComponent {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.config.data) {
|
const places: Place[] | undefined = this.config.data?.places;
|
||||||
let places: Place[] = this.config.data.places;
|
if (places) {
|
||||||
this.selectedPlaces.push(...places);
|
this.selectedPlaces = [...places];
|
||||||
this.selectedPlacesID = places.map((p) => p.id);
|
this.selectedPlacesID = places.map((p) => p.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ export class TripPlaceSelectModalComponent {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let v = value.toLowerCase();
|
const v = value.toLowerCase();
|
||||||
this.displayedPlaces = this.places.filter(
|
this.displayedPlaces = this.places.filter(
|
||||||
(p) =>
|
(p) =>
|
||||||
p.name.toLowerCase().includes(v) ||
|
p.name.toLowerCase().includes(v) ||
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user