Making createdBy field required
All checks were successful
Jenkins Production Deployment

This commit is contained in:
Patrick Müller 2022-12-25 21:50:21 +01:00
parent 6cb7f0d59b
commit 65a5e91ad1
Signed by: Paddy
GPG Key ID: 37ABC11275CAABCE
2 changed files with 5 additions and 4 deletions

3
app.ts
View File

@ -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) {

View File

@ -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;