This commit is contained in:
parent
6cb7f0d59b
commit
65a5e91ad1
3
app.ts
3
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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user