Skip to content

[server] added UpdateTeam #15749

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

Closed
wants to merge 1 commit into from

Conversation

svenefftinge
Copy link
Contributor

@svenefftinge svenefftinge commented Jan 16, 2023

Description

Adds an updateTeam call to the server component.

Related Issue(s)

See #5067

How to test

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@svenefftinge svenefftinge requested a review from a team January 16, 2023 10:19
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Jan 16, 2023
@svenefftinge svenefftinge force-pushed the sefftinge/allow-users-to-rename-5067 branch 2 times, most recently from affae41 to da72dae Compare January 16, 2023 10:30
@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-sefftinge-allow-users-to-rename-5067.4 because the annotations in the pull request description changed
(with .werft/ from main)

@svenefftinge
Copy link
Contributor Author

/hold

@@ -122,6 +122,18 @@ export class TeamDBImpl implements TeamDB {
return soleOwnedTeams;
}

public async updateTeam(team: Partial<Team>): Promise<Team> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The signature here is possibly misleading. You can only update the team name, but you can pass in the whole team. Does it make sense to be explicit with which fields are acceptable?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to also check the team name is not empty? Currently I could set the name to empty

throw new ResponseError(ErrorCodes.NOT_FOUND, `Team ${team.id} does not exist`);
}
const members = await this.teamDB.findMembersByTeam(teamId);
await this.guardAccess({ kind: "team", subject: existingTeam, members }, "update");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For others reading this, the update action is only allowed if you're the team owner.

@svenefftinge svenefftinge changed the title [public-api] added UpdateTeam [server] added UpdateTeam Jan 16, 2023
@svenefftinge svenefftinge force-pushed the sefftinge/allow-users-to-rename-5067 branch from da72dae to 1c90cb2 Compare January 16, 2023 13:48
@easyCZ easyCZ mentioned this pull request Jan 16, 2023
4 tasks
@svenefftinge svenefftinge deleted the sefftinge/allow-users-to-rename-5067 branch January 17, 2023 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Validation
Development

Successfully merging this pull request may close these issues.

3 participants