Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot rename project with current implementation #16

Open
agaudreault opened this issue Oct 25, 2019 · 0 comments
Open

Cannot rename project with current implementation #16

agaudreault opened this issue Oct 25, 2019 · 0 comments

Comments

@agaudreault
Copy link

agaudreault commented Oct 25, 2019

It is impossible to use the Update project method to rename a project. Sending an object requires us to use the current slug. we can update the Name property but this one maps to the Legacy Name.

The current implementation use the slug from the object. Instead, the slug should be a separate parameter UpdateProject(o Organization, projectSlug string, p Project)

Another problem is to get the output value of the update method. For that, we should be able to pass a reference to the update method.

Current implementation:

// UpdateProject takes a organization and project then updates it on the server side
func (c *Client) UpdateProject(o Organization, p Project) error {
	return c.do("PUT", fmt.Sprintf("projects/%s/%s", *o.Slug, *p.Slug), &p, &p)
}

Suggested implementation:

// UpdateProject takes a organization and project then updates it on the server side
func (c *Client) UpdateProject(o Organization, projectSlug string, p *Project) error {
	return c.do("PUT", fmt.Sprintf("projects/%s/%s", *o.Slug, projectSlug), p, p)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant