Skip to content

Commit ef33dad

Browse files
committed
[db] Fix maintenanceMode update
1 parent 1074089 commit ef33dad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/gitpod-db/src/typeorm/team-db-impl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ export class TeamDBImpl extends TransactionalDBImpl<TeamDB> implements TeamDB {
156156

157157
public async updateTeam(teamId: string, team: Pick<Team, "name" | "maintenanceMode">): Promise<Team> {
158158
const name = team.name && team.name.trim();
159-
const maintenanceMode = team.maintenanceMode;
160-
if (!name && !maintenanceMode) {
159+
const maintenanceModeSet = team.maintenanceMode !== undefined;
160+
if (!name && !maintenanceModeSet) {
161161
throw new ApplicationError(ErrorCodes.BAD_REQUEST, "No update provided");
162162
}
163163

@@ -183,7 +183,7 @@ export class TeamDBImpl extends TransactionalDBImpl<TeamDB> implements TeamDB {
183183
}
184184

185185
// Update maintenance mode if provided
186-
if (maintenanceMode) {
186+
if (maintenanceModeSet) {
187187
existingTeam.maintenanceMode = team.maintenanceMode;
188188
}
189189

0 commit comments

Comments
 (0)