Skip to content

Cannot rename project with current implementation #16

Open
@agaudreault

Description

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)
}

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions