backend: Rename expirationDate to autoDeletionDate in room-related files for consistency
This commit is contained in:
parent
eb06643364
commit
84d68ba31b
@ -13,7 +13,7 @@ export class MeetRoomHelper {
|
||||
*/
|
||||
static toOpenViduOptions(room: MeetRoom): MeetRoomOptions {
|
||||
return {
|
||||
expirationDate: room.expirationDate,
|
||||
autoDeletionDate: room.autoDeletionDate,
|
||||
// maxParticipants: room.maxParticipants,
|
||||
preferences: room.preferences,
|
||||
roomIdPrefix: room.roomIdPrefix
|
||||
|
||||
@ -44,7 +44,7 @@ const RoomPreferencesSchema: z.ZodType<MeetRoomPreferences> = z.object({
|
||||
});
|
||||
|
||||
const RoomRequestOptionsSchema: z.ZodType<MeetRoomOptions> = z.object({
|
||||
expirationDate: z
|
||||
autoDeletionDate: z
|
||||
.number()
|
||||
.positive('Expiration date must be a positive integer')
|
||||
.min(Date.now(), 'Expiration date must be in the future'),
|
||||
|
||||
@ -50,7 +50,7 @@ export class RoomService {
|
||||
*
|
||||
*/
|
||||
async createMeetRoom(baseUrl: string, roomOptions: MeetRoomOptions): Promise<MeetRoom> {
|
||||
const { preferences, expirationDate, roomIdPrefix } = roomOptions;
|
||||
const { preferences, autoDeletionDate, roomIdPrefix } = roomOptions;
|
||||
const roomId = roomIdPrefix ? `${roomIdPrefix}-${uid(15)}` : uid(15);
|
||||
|
||||
const meetRoom: MeetRoom = {
|
||||
@ -58,7 +58,7 @@ export class RoomService {
|
||||
roomIdPrefix,
|
||||
creationDate: Date.now(),
|
||||
// maxParticipants,
|
||||
expirationDate,
|
||||
autoDeletionDate,
|
||||
preferences,
|
||||
moderatorRoomUrl: `${baseUrl}/room/${roomId}?secret=${secureUid(10)}`,
|
||||
publisherRoomUrl: `${baseUrl}/room/${roomId}?secret=${secureUid(10)}`
|
||||
@ -304,7 +304,7 @@ export class RoomService {
|
||||
nextPageToken = token;
|
||||
|
||||
const expiredRoomIds = rooms
|
||||
.filter((room) => room.expirationDate && room.expirationDate < now)
|
||||
.filter((room) => room.autoDeletionDate && room.autoDeletionDate < now)
|
||||
.map((room) => room.roomId);
|
||||
|
||||
if (expiredRoomIds.length > 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user