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

[FIX] Channel is automatically getting added to the first option in move to team feature #22670

Merged
merged 4 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions app/api/server/v1/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ API.v1.addRoute('teams.addRooms', { authRequired: true }, {
post() {
const { rooms, teamId, teamName } = this.bodyParams;

if (!teamId && !teamName) {
return API.v1.failure('missing-teamId-or-teamName');
}

const team = teamId ? Promise.await(Team.getOneById(teamId)) : Promise.await(Team.getOneByName(teamName));
if (!team) {
return API.v1.failure('team-does-not-exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const StepOne = ({ teamId = '', onChange, onClose, onCancel, onConfirm }) => {
onClose={onClose}
onCancel={onCancel}
onConfirm={onConfirm}
confirmDisabled={!teamId}
>
<Margins blockEnd='x20'>
<Box>{t('Teams_move_channel_to_team_description_first')}</Box>
Expand Down