mirror of
https://github.com/kovetskiy/mark.git
synced 2026-05-03 05:42:35 +00:00
fix: restore fallback in GetUserByName for older Confluence APIs
This commit is contained in:
@@ -735,13 +735,10 @@ func (api *API) GetUserByName(name string) (*User, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if request.Raw.StatusCode != http.StatusOK {
|
|
||||||
return nil, newErrorStatusNotOK(request)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try old path
|
// Try old path
|
||||||
if len(response.Results) == 0 {
|
if request.Raw.StatusCode != http.StatusOK || len(response.Results) == 0 {
|
||||||
request, err := api.rest.
|
request, err = api.rest.
|
||||||
Res("search", &response).
|
Res("search", &response).
|
||||||
Get(map[string]string{
|
Get(map[string]string{
|
||||||
"cql": fmt.Sprintf("user.fullname~%q", name),
|
"cql": fmt.Sprintf("user.fullname~%q", name),
|
||||||
|
|||||||
Reference in New Issue
Block a user