backend: refine updateMeetRoomStatus to always save changes in storage
This commit is contained in:
parent
982247736e
commit
2475f7a8e2
@ -156,18 +156,19 @@ export class RoomService {
|
|||||||
*/
|
*/
|
||||||
async updateMeetRoomStatus(roomId: string, status: MeetRoomStatus): Promise<{ room: MeetRoom; updated: boolean }> {
|
async updateMeetRoomStatus(roomId: string, status: MeetRoomStatus): Promise<{ room: MeetRoom; updated: boolean }> {
|
||||||
const room = await this.getMeetRoom(roomId);
|
const room = await this.getMeetRoom(roomId);
|
||||||
|
let updated = true;
|
||||||
|
|
||||||
// If closing the room while a meeting is active, mark it to be closed when the meeting ends
|
// If closing the room while a meeting is active, mark it to be closed when the meeting ends
|
||||||
if (status === MeetRoomStatus.CLOSED && room.status === MeetRoomStatus.ACTIVE_MEETING) {
|
if (status === MeetRoomStatus.CLOSED && room.status === MeetRoomStatus.ACTIVE_MEETING) {
|
||||||
room.meetingEndAction = MeetingEndAction.CLOSE;
|
room.meetingEndAction = MeetingEndAction.CLOSE;
|
||||||
return { room, updated: false };
|
updated = false;
|
||||||
} else {
|
} else {
|
||||||
room.status = status;
|
room.status = status;
|
||||||
room.meetingEndAction = MeetingEndAction.NONE;
|
room.meetingEndAction = MeetingEndAction.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.storageService.saveMeetRoom(room);
|
await this.storageService.saveMeetRoom(room);
|
||||||
return { room, updated: true };
|
return { room, updated };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user