Skip to content

Commit

Permalink
Merge pull request #67 from iljaSL/api-endpoint/update-role
Browse files Browse the repository at this point in the history
feat(API): add a new API endpoint to role-store, update role
  • Loading branch information
kimmokssh committed Apr 6, 2021
2 parents bb71e21 + cd9ed56 commit 49ec779
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/rolestore/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ func New(api restapi.Connector) *RoleStore {
return &RoleStore{api: api}
}

// UpdateRole update existing role
func (store *RoleStore) UpdateRole(id string, role *Role) error {
_, err := store.api.
URL("/role-store/api/v1/roles/%s", url.PathEscape(id)).
Put(role)

return err
}

// DeleteRole delete a role
func (store *RoleStore) DeleteRole(id string) error {
_, err := store.api.
Expand Down

0 comments on commit 49ec779

Please sign in to comment.