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
|
// Configure CORS
|
||||||
let allowedHosts = [
|
let allowedHosts = [
|
||||||
'https://www.nachklang.art',
|
'https://www.nachklang.art',
|
||||||
'https://calendar.nachklang.art',
|
'https://calendar.nachklang.art'
|
||||||
'http://localhost:4200'
|
|
||||||
];
|
];
|
||||||
app.use(cors({
|
app.use(cors({
|
||||||
origin: function (origin: any, callback: any) {
|
origin: function (origin: any, callback: any) {
|
||||||
|
|
|
@ -123,7 +123,8 @@ eventsRouter.post('/', async (req: Request, res: Response) => {
|
||||||
req.body.calendarId === undefined ||
|
req.body.calendarId === undefined ||
|
||||||
isNullOrBlank(req.body.name) ||
|
isNullOrBlank(req.body.name) ||
|
||||||
req.body.startDateTime === undefined ||
|
req.body.startDateTime === undefined ||
|
||||||
req.body.endDateTime === undefined
|
req.body.endDateTime === undefined ||
|
||||||
|
isNullOrBlank(req.body.createdBy)
|
||||||
) {
|
) {
|
||||||
res.status(400).send({'message': 'Required parameters missing'});
|
res.status(400).send({'message': 'Required parameters missing'});
|
||||||
return;
|
return;
|
||||||
|
@ -172,7 +173,8 @@ eventsRouter.put('/:eventId', async (req: Request, res: Response) => {
|
||||||
req.body.calendarId === undefined ||
|
req.body.calendarId === undefined ||
|
||||||
isNullOrBlank(req.body.name) ||
|
isNullOrBlank(req.body.name) ||
|
||||||
req.body.startDateTime === undefined ||
|
req.body.startDateTime === undefined ||
|
||||||
req.body.endDateTime === undefined
|
req.body.endDateTime === undefined ||
|
||||||
|
isNullOrBlank(req.body.createdBy)
|
||||||
) {
|
) {
|
||||||
res.status(400).send({'message': 'Required parameters missing'});
|
res.status(400).send({'message': 'Required parameters missing'});
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user