feat: improve locatore formatting by trimming spaces and replacing multiple spaces with a single space
This commit is contained in:
parent
e46af92bb3
commit
53ba53e3cc
1 changed files with 4 additions and 1 deletions
|
|
@ -416,7 +416,10 @@ func processLocatore(tmp *typesdefs.AnnuncioParsed, annuncio *typesdefs.Annuncio
|
||||||
}
|
}
|
||||||
tmp.Numero = &number
|
tmp.Numero = &number
|
||||||
if trg.Cognome != nil && trg.Nome != nil {
|
if trg.Cognome != nil && trg.Nome != nil {
|
||||||
tmp.Locatore = strUpd(fmt.Sprintf("%s %s", utils.MakeUppercase(*trg.Cognome), utils.MakeUppercase(*trg.Nome)))
|
rawLoc := fmt.Sprintf("%s %s", utils.MakeUppercase(*trg.Cognome), utils.MakeUppercase(*trg.Nome))
|
||||||
|
rawLoc = strings.TrimSpace(rawLoc)
|
||||||
|
rawLoc = regexp.MustCompile(`\s+`).ReplaceAllString(rawLoc, " ") // Replace multiple spaces with a single space
|
||||||
|
tmp.Locatore = strUpd(rawLoc)
|
||||||
}
|
}
|
||||||
tmp.Idlocatore = trg.Id
|
tmp.Idlocatore = trg.Id
|
||||||
tmp.Tipo_locatore = strUpd(flatClienteTipologia(trg.Tipologie))
|
tmp.Tipo_locatore = strUpd(flatClienteTipologia(trg.Tipologie))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue