empty strings or zero will be converted to null
This commit is contained in:
@@ -41,16 +41,18 @@ export class ValidatedLocationComponent extends BaseInputComponent {
|
||||
}
|
||||
onInputChange(event: Place): void {
|
||||
this.value = event; //{ ...event, longitude: parseFloat(event.longitude), latitude: parseFloat(event.latitude) };
|
||||
this.value = {
|
||||
id: event?.place_id,
|
||||
name: event?.address.city,
|
||||
county: event?.address.county,
|
||||
street: event?.address.road,
|
||||
housenumber: event?.address.house_number,
|
||||
state: event?.address['ISO3166-2-lvl4'].substr(3),
|
||||
latitude: event ? parseFloat(event?.lat) : undefined,
|
||||
longitude: event ? parseFloat(event?.lon) : undefined,
|
||||
};
|
||||
if (event) {
|
||||
this.value = {
|
||||
id: event?.place_id,
|
||||
name: event?.address.city,
|
||||
county: event?.address.county,
|
||||
street: event?.address.road,
|
||||
housenumber: event?.address.house_number,
|
||||
state: event?.address['ISO3166-2-lvl4'].substr(3),
|
||||
latitude: event ? parseFloat(event?.lat) : undefined,
|
||||
longitude: event ? parseFloat(event?.lon) : undefined,
|
||||
};
|
||||
}
|
||||
this.onChange(this.value);
|
||||
}
|
||||
private loadCities() {
|
||||
|
||||
Reference in New Issue
Block a user