Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

fix wrong url for edit and delete team API #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gitea/org_team.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ func (c *Client) CreateTeam(org string, opt structs.CreateTeamOption) (*Team, er
}

// EditTeam edits a team of an organization
func (c *Client) EditTeam(org string, id int64, opt structs.EditTeamOption) error {
func (c *Client) EditTeam(id int64, opt structs.EditTeamOption) error {
body, err := json.Marshal(&opt)
if err != nil {
return err
}
_, err = c.getResponse("PATCH", fmt.Sprintf("/orgs/%s/teams/%d", org, id), jsonHeader, bytes.NewReader(body))
_, err = c.getResponse("PATCH", fmt.Sprintf("/teams/%d", id), jsonHeader, bytes.NewReader(body))
return err
}

// DeleteTeam deletes a team of an organization
func (c *Client) DeleteTeam(org string, id int64) error {
_, err := c.getResponse("DELETE", fmt.Sprintf("/orgs/%s/teams/%d", org, id), nil, nil)
func (c *Client) DeleteTeam(id int64) error {
_, err := c.getResponse("DELETE", fmt.Sprintf("/teams/%d", id), nil, nil)
return err
}

Expand Down