Skip to content

Commit

Permalink
feat(search-street): update locality after street selection
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabauke authored and luytena committed Apr 18, 2024
1 parent 98c0290 commit a31b818
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions addon/controllers/building/edit/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ export default class BuildingFormController extends ImportController {
this.fetchBuildingWork.perform();
}

@action
syncLocalityWithStreet(changeset, streetList) {
changeset.set("building.buildingEntrance.locality.name.nameLong", streetList.locality.name.nameLong)
changeset.set("building.buildingEntrance.locality.swissZipCode", streetList.locality.swissZipCode)
changeset.set("building.buildingEntrance.locality.swissZipCodeAddOn", streetList.locality.swissZipCodeAddOn)
}

@dropTask
*saveBuildingWork() {
try {
Expand Down
1 change: 1 addition & 0 deletions addon/templates/building/edit/form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
changeset "building.buildingEntrance.locality"
)
}}
@on-update={{fn this.syncLocalityWithStreet changeset}}
@disabled={{not
(changeset-get
changeset "building.buildingEntrance.locality.swissZipCode"
Expand Down

0 comments on commit a31b818

Please sign in to comment.