Skip to content

Commit

Permalink
split on last occurance of council name, not first in dropdown options
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Mar 17, 2023
1 parent fd821af commit a5ec13e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/address-autocomplete/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,12 @@ export class AddressAutocomplete extends LitElement {
.map((address: Address) => {
// omit the council name and postcode from the display name
this._options.push(
address.LPI.ADDRESS.split(
`, ${address.LPI.ADMINISTRATIVE_AREA}`
)[0]
address.LPI.ADDRESS.slice(
0,
address.LPI.ADDRESS.lastIndexOf(
`, ${address.LPI.ADMINISTRATIVE_AREA}`
)
)
);
});

Expand Down

0 comments on commit a5ec13e

Please sign in to comment.