diff --git a/app.ts b/app.ts index c102ad7..e6d9b05 100644 --- a/app.ts +++ b/app.ts @@ -29,8 +29,7 @@ app.use(express.json()); // Configure CORS let allowedHosts = [ 'https://www.nachklang.art', - 'https://calendar.nachklang.art', - 'http://localhost:4200' + 'https://calendar.nachklang.art' ]; app.use(cors({ origin: function (origin: any, callback: any) { diff --git a/src/models/calendar/events/events.router.ts b/src/models/calendar/events/events.router.ts index 93482bc..f562bde 100644 --- a/src/models/calendar/events/events.router.ts +++ b/src/models/calendar/events/events.router.ts @@ -123,7 +123,8 @@ eventsRouter.post('/', async (req: Request, res: Response) => { req.body.calendarId === undefined || isNullOrBlank(req.body.name) || req.body.startDateTime === undefined || - req.body.endDateTime === undefined + req.body.endDateTime === undefined || + isNullOrBlank(req.body.createdBy) ) { res.status(400).send({'message': 'Required parameters missing'}); return; @@ -172,7 +173,8 @@ eventsRouter.put('/:eventId', async (req: Request, res: Response) => { req.body.calendarId === undefined || isNullOrBlank(req.body.name) || req.body.startDateTime === undefined || - req.body.endDateTime === undefined + req.body.endDateTime === undefined || + isNullOrBlank(req.body.createdBy) ) { res.status(400).send({'message': 'Required parameters missing'}); return;