@@ -23,6 +23,7 @@ import { rtcQueue } from "../../../queue";
2323import { aliGreenText } from "../../../utils/AliGreen" ;
2424import { ControllerError } from "../../../../error/ControllerError" ;
2525import { dataSource } from "../../../../thirdPartyService/TypeORMService" ;
26+ import { Whiteboard } from "../../../../constants/Config" ;
2627
2728@Controller < RequestType , ResponseType > ( {
2829 method : "post" ,
@@ -33,7 +34,7 @@ export class CreatePeriodic extends AbstractController<RequestType, ResponseType
3334 public static readonly schema : FastifySchema < RequestType > = {
3435 body : {
3536 type : "object" ,
36- required : [ "title" , "type" , "beginTime" , "endTime" , "region" , " periodic"] ,
37+ required : [ "title" , "type" , "beginTime" , "endTime" , "periodic" ] ,
3738 properties : {
3839 title : {
3940 type : "string" ,
@@ -54,6 +55,7 @@ export class CreatePeriodic extends AbstractController<RequestType, ResponseType
5455 region : {
5556 type : "string" ,
5657 enum : [ Region . CN_HZ , Region . US_SV , Region . SG , Region . IN_MUM , Region . GB_LON ] ,
58+ nullable : true ,
5759 } ,
5860 periodic : {
5961 type : "object" ,
@@ -105,7 +107,8 @@ export class CreatePeriodic extends AbstractController<RequestType, ResponseType
105107 private readonly periodicUUID = v4 ( ) ;
106108
107109 public async execute ( ) : Promise < Response < ResponseType > > {
108- const { title, type, beginTime, endTime, region, periodic } = this . body ;
110+ const region = Whiteboard . region as Region ;
111+ const { title, type, beginTime, endTime, periodic } = this . body ;
109112 const userUUID = this . userUUID ;
110113
111114 if ( await aliGreenText . textNonCompliant ( title ) ) {
@@ -224,7 +227,7 @@ interface RequestType {
224227 type : RoomType ;
225228 beginTime : number ;
226229 endTime : number ;
227- region : Region ;
230+ region ? : Region ;
228231 periodic : Periodic ;
229232 } ;
230233}
0 commit comments