update customer
This commit is contained in:
@@ -133,13 +133,18 @@ func (s *CustomerServer) handleGetCustomer(w http.ResponseWriter, r *http.Reques
|
||||
})
|
||||
}
|
||||
|
||||
// isValidProfileId tries to parse a numeric or base62-encoded profile id.
|
||||
// isValidProfileId parses a profile ID string that is either a bare decimal
|
||||
// number (legacy backoffice IDs) or a base62-encoded identifier (generated by
|
||||
// the UCP profile service via profile.NewProfileId). It uses profile.ParseProfileId
|
||||
// for the base62 case so both formats are handled consistently.
|
||||
func isValidProfileId(id string) (uint64, bool) {
|
||||
// Bare decimal (legacy backoffice listing returns numeric IDs).
|
||||
if nr, err := strconv.ParseUint(id, 10, 64); err == nil {
|
||||
return nr, true
|
||||
}
|
||||
if nr, err := strconv.ParseUint(id, 36, 64); err == nil {
|
||||
return nr, true
|
||||
// Base62 — the format used by the UCP profile service (cmd/profile).
|
||||
if pid, ok := profile.ParseProfileId(id); ok {
|
||||
return uint64(pid), true
|
||||
}
|
||||
return 0, false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user