empty strings or zero will be converted to null
This commit is contained in:
parent
83307684ee
commit
fe759f953f
|
|
@ -27,8 +27,8 @@ export class ValidatedInputComponent extends BaseInputComponent {
|
||||||
super(validationMessagesService);
|
super(validationMessagesService);
|
||||||
}
|
}
|
||||||
|
|
||||||
onInputChange(event: Event): void {
|
onInputChange(event: string): void {
|
||||||
this.value = event;
|
this.value = event?.length > 0 ? event : null;
|
||||||
this.onChange(event);
|
this.onChange(this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,16 +41,18 @@ export class ValidatedLocationComponent extends BaseInputComponent {
|
||||||
}
|
}
|
||||||
onInputChange(event: Place): void {
|
onInputChange(event: Place): void {
|
||||||
this.value = event; //{ ...event, longitude: parseFloat(event.longitude), latitude: parseFloat(event.latitude) };
|
this.value = event; //{ ...event, longitude: parseFloat(event.longitude), latitude: parseFloat(event.latitude) };
|
||||||
this.value = {
|
if (event) {
|
||||||
id: event?.place_id,
|
this.value = {
|
||||||
name: event?.address.city,
|
id: event?.place_id,
|
||||||
county: event?.address.county,
|
name: event?.address.city,
|
||||||
street: event?.address.road,
|
county: event?.address.county,
|
||||||
housenumber: event?.address.house_number,
|
street: event?.address.road,
|
||||||
state: event?.address['ISO3166-2-lvl4'].substr(3),
|
housenumber: event?.address.house_number,
|
||||||
latitude: event ? parseFloat(event?.lat) : undefined,
|
state: event?.address['ISO3166-2-lvl4'].substr(3),
|
||||||
longitude: event ? parseFloat(event?.lon) : undefined,
|
latitude: event ? parseFloat(event?.lat) : undefined,
|
||||||
};
|
longitude: event ? parseFloat(event?.lon) : undefined,
|
||||||
|
};
|
||||||
|
}
|
||||||
this.onChange(this.value);
|
this.onChange(this.value);
|
||||||
}
|
}
|
||||||
private loadCities() {
|
private loadCities() {
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,6 @@ export class ValidatedPriceComponent extends BaseInputComponent {
|
||||||
|
|
||||||
onInputChange(event: Event): void {
|
onInputChange(event: Event): void {
|
||||||
this.value = !event ? null : event;
|
this.value = !event ? null : event;
|
||||||
this.onChange(event);
|
this.onChange(this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ export class ValidatedTextareaComponent extends BaseInputComponent {
|
||||||
super(validationMessagesService);
|
super(validationMessagesService);
|
||||||
}
|
}
|
||||||
|
|
||||||
onInputChange(event: Event): void {
|
onInputChange(event: string): void {
|
||||||
this.value = event;
|
this.value = event?.length > 0 ? event : null;
|
||||||
this.onChange(this.value);
|
this.onChange(this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<div class="md:col-span-2">
|
<div class="md:col-span-2">
|
||||||
<label for="email" class="block text-sm font-medium text-gray-700">E-mail (required)</label>
|
<label for="email" class="block text-sm font-medium text-gray-700">E-mail (required)</label>
|
||||||
<input type="email" id="email" name="email" [(ngModel)]="user.email" disabled class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" />
|
<input type="email" id="email" name="email" [(ngModel)]="user.email" disabled class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" />
|
||||||
<p class="text-xs text-gray-500 mt-1">You can only modify your email by contacting us at support@bizwatch.net</p>
|
<p class="text-xs text-gray-500 mt-1">You can only modify your email by contacting us at support@bizmatch.net</p>
|
||||||
</div>
|
</div>
|
||||||
@if (isProfessional || isAdmin()){
|
@if (isProfessional || isAdmin()){
|
||||||
<div class="flex flex-row items-center justify-around md:space-x-4">
|
<div class="flex flex-row items-center justify-around md:space-x-4">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue