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 {
|
static toOpenViduOptions(room: MeetRoom): MeetRoomOptions {
|
||||||
return {
|
return {
|
||||||
expirationDate: room.expirationDate,
|
autoDeletionDate: room.autoDeletionDate,
|
||||||
// maxParticipants: room.maxParticipants,
|
// maxParticipants: room.maxParticipants,
|
||||||
preferences: room.preferences,
|
preferences: room.preferences,
|
||||||
roomIdPrefix: room.roomIdPrefix
|
roomIdPrefix: room.roomIdPrefix
|
||||||
|
|||||||
@ -44,7 +44,7 @@ const RoomPreferencesSchema: z.ZodType<MeetRoomPreferences> = z.object({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const RoomRequestOptionsSchema: z.ZodType<MeetRoomOptions> = z.object({
|
const RoomRequestOptionsSchema: z.ZodType<MeetRoomOptions> = z.object({
|
||||||
expirationDate: z
|
autoDeletionDate: z
|
||||||
.number()
|
.number()
|
||||||
.positive('Expiration date must be a positive integer')
|
.positive('Expiration date must be a positive integer')
|
||||||
.min(Date.now(), 'Expiration date must be in the future'),
|
.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> {
|
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 roomId = roomIdPrefix ? `${roomIdPrefix}-${uid(15)}` : uid(15);
|
||||||
|
|
||||||
const meetRoom: MeetRoom = {
|
const meetRoom: MeetRoom = {
|
||||||
@ -58,7 +58,7 @@ export class RoomService {
|
|||||||
roomIdPrefix,
|
roomIdPrefix,
|
||||||
creationDate: Date.now(),
|
creationDate: Date.now(),
|
||||||
// maxParticipants,
|
// maxParticipants,
|
||||||
expirationDate,
|
autoDeletionDate,
|
||||||
preferences,
|
preferences,
|
||||||
moderatorRoomUrl: `${baseUrl}/room/${roomId}?secret=${secureUid(10)}`,
|
moderatorRoomUrl: `${baseUrl}/room/${roomId}?secret=${secureUid(10)}`,
|
||||||
publisherRoomUrl: `${baseUrl}/room/${roomId}?secret=${secureUid(10)}`
|
publisherRoomUrl: `${baseUrl}/room/${roomId}?secret=${secureUid(10)}`
|
||||||
@ -304,7 +304,7 @@ export class RoomService {
|
|||||||
nextPageToken = token;
|
nextPageToken = token;
|
||||||
|
|
||||||
const expiredRoomIds = rooms
|
const expiredRoomIds = rooms
|
||||||
.filter((room) => room.expirationDate && room.expirationDate < now)
|
.filter((room) => room.autoDeletionDate && room.autoDeletionDate < now)
|
||||||
.map((room) => room.roomId);
|
.map((room) => room.roomId);
|
||||||
|
|
||||||
if (expiredRoomIds.length > 0) {
|
if (expiredRoomIds.length > 0) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user