Skip to content

Commit b2e6cc1

Browse files
committed
stopped using the postal server expand endpoint due to erroneous results
1 parent 1eed6f8 commit b2e6cc1

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

engine/plugins/support/normalization.go

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,9 @@ func StreetAddressToLocation(address string) *contact.Location {
308308
return nil
309309
}
310310

311-
var err error
312-
var loc contact.Location
313-
loc.Address, err = expandAddress(address)
314-
if err != nil {
315-
return nil
316-
}
317-
311+
loc := &contact.Location{Address: address}
318312
parsed, err := parseAddress(loc.Address)
319-
if err != nil || len(parsed.Parts) < 4 {
313+
if err != nil {
320314
return nil
321315
}
322316

@@ -348,11 +342,7 @@ func StreetAddressToLocation(address string) *contact.Location {
348342
}
349343
}
350344
}
351-
if (loc.Building == "" && loc.BuildingNumber == "") ||
352-
loc.StreetName == "" || loc.City == "" || loc.Province == "" {
353-
return nil
354-
}
355-
return &loc
345+
return loc
356346
}
357347

358348
type parsed struct {
@@ -381,6 +371,7 @@ func parseAddress(address string) (*parsed, error) {
381371
return &p, nil
382372
}
383373

374+
/*
384375
func expandAddress(address string) (string, error) {
385376
if postalHost == "" || postalPort == "" {
386377
return "", errors.New("no postal server information provided")
@@ -408,3 +399,4 @@ func expandAddress(address string) (string, error) {
408399
}
409400
return ex.Forms[num-1], nil
410401
}
402+
*/

0 commit comments

Comments
 (0)