Skip to content

Commit 5109ac7

Browse files
authored
feat(mongodb): fix typo the CreateUser url (scaleway#2291)
1 parent 76962a0 commit 5109ac7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

api/mongodb/v1alpha1/mongodb_sdk.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ type CreateUserRequest struct {
727727
InstanceID string `json:"-"`
728728

729729
// Name: name of the database user.
730-
Name string `json:"-"`
730+
Name string `json:"name"`
731731

732732
// Password: password of the database user.
733733
Password string `json:"password"`
@@ -1705,13 +1705,9 @@ func (s *API) CreateUser(req *CreateUserRequest, opts ...scw.RequestOption) (*Us
17051705
return nil, errors.New("field InstanceID cannot be empty in request")
17061706
}
17071707

1708-
if fmt.Sprint(req.Name) == "" {
1709-
return nil, errors.New("field Name cannot be empty in request")
1710-
}
1711-
17121708
scwReq := &scw.ScalewayRequest{
17131709
Method: "POST",
1714-
Path: "/mongodb/v1alpha1/regions/" + fmt.Sprint(req.Region) + "/instances/" + fmt.Sprint(req.InstanceID) + "/users/" + fmt.Sprint(req.Name) + "",
1710+
Path: "/mongodb/v1alpha1/regions/" + fmt.Sprint(req.Region) + "/instances/" + fmt.Sprint(req.InstanceID) + "/users",
17151711
}
17161712

17171713
err = scwReq.SetBody(req)

0 commit comments

Comments
 (0)