diff --git a/src/app/components/user/forms/address/add-edit-address-form.component.html b/src/app/components/user/forms/address/add-edit-address-form.component.html index ebe0662..f16cc9d 100644 --- a/src/app/components/user/forms/address/add-edit-address-form.component.html +++ b/src/app/components/user/forms/address/add-edit-address-form.component.html @@ -7,7 +7,7 @@ Country - + {{country.name}} @@ -21,7 +21,7 @@ City - + {{city.name}} diff --git a/src/app/components/user/forms/address/add-edit-address-form.component.ts b/src/app/components/user/forms/address/add-edit-address-form.component.ts index 7da8754..11c2fd3 100644 --- a/src/app/components/user/forms/address/add-edit-address-form.component.ts +++ b/src/app/components/user/forms/address/add-edit-address-form.component.ts @@ -97,8 +97,8 @@ export class AddEditAddressForm extends AbstractForm implements OnDestroy, OnIni * Handles the city selection event. Loads postal codes based on the selected city. * @param city The selected city. */ - protected onCitySelected(city: City): void{ - this.postalCodeService.getAll(true, city.name).subscribe(() => { + protected onCitySelected(): void{ + this.postalCodeService.getAll(true, this.selectedCity).subscribe(() => { this.selectedPostalCode = ''; this.loadPostalCodes(); }) @@ -108,8 +108,8 @@ export class AddEditAddressForm extends AbstractForm implements OnDestroy, OnIni * Handles the country selection event. Loads cities and resets selected city and postal code. * @param country The selected country. */ - protected onCountrySelected(country: Country): void{ - this.cityService.getAll(true, country.name).subscribe(() => { + protected onCountrySelected(): void{ + this.cityService.getAll(true, this.selectedCountry).subscribe(() => { this.selectedCity = ''; this.selectedPostalCode = ''; this.loadCities(); @@ -121,7 +121,7 @@ export class AddEditAddressForm extends AbstractForm implements OnDestroy, OnIni * Loads cities based on the selected country. */ private loadCities(): void{ - this.citySubscription = this.cityService.getAll(true,this.selectedCountry).subscribe(cityList => { + this.citySubscription = this.cityService.getAll(true, this.selectedCountry).subscribe(cityList => { this.cities = cityList; }); } diff --git a/src/app/services/city/city.service.ts b/src/app/services/city/city.service.ts index 3bad1bf..ac1240c 100644 --- a/src/app/services/city/city.service.ts +++ b/src/app/services/city/city.service.ts @@ -35,7 +35,7 @@ export class CityService extends AbstractService { public override getAll(active?: boolean, name?: string): Observable { const queryParams = this.queryBuilderService.buildQueryParams({ active, - name: name + country_name: name }); const searchUrl = `${this.baseUrl}/search${queryParams}`;