@@ -125,7 +125,7 @@ eventsRouter.post('/', async (req: Request, res: Response) => {
|
||||
|
||||
let user = await UserService.checkSession(sessionId, sessionKey, ip);
|
||||
|
||||
if (!user.is_active) {
|
||||
if (!user.isActive) {
|
||||
res.status(403).send({'message': 'You do not have access to the specified calendar.'});
|
||||
return;
|
||||
}
|
||||
@@ -150,7 +150,7 @@ eventsRouter.post('/', async (req: Request, res: Response) => {
|
||||
endDateTime: new Date(req.body.endDateTime),
|
||||
createdDate: new Date(),
|
||||
location: req.body.location ?? '',
|
||||
createdById: user.user_id ?? -1,
|
||||
createdById: user.userId ?? -1,
|
||||
url: req.body.url ?? '',
|
||||
wholeDay: req.body.wholeDay ?? false
|
||||
};
|
||||
@@ -181,7 +181,7 @@ eventsRouter.put('/:eventId', async (req: Request, res: Response) => {
|
||||
|
||||
let user = await UserService.checkSession(sessionId, sessionKey, ip);
|
||||
|
||||
if (!user.is_active) {
|
||||
if (!user.isActive) {
|
||||
res.status(403).send({'message': 'You do not have access to the specified calendar.'});
|
||||
return;
|
||||
}
|
||||
@@ -208,7 +208,7 @@ eventsRouter.put('/:eventId', async (req: Request, res: Response) => {
|
||||
createdDate: new Date(),
|
||||
location: req.body.location ?? '',
|
||||
createdBy: req.body.createdBy ?? '',
|
||||
createdById: user.user_id ?? -1,
|
||||
createdById: user.userId ?? -1,
|
||||
url: req.body.url ?? '',
|
||||
wholeDay: req.body.wholeDay ?? false
|
||||
};
|
||||
@@ -242,7 +242,7 @@ eventsRouter.delete('/:eventId', async (req: Request, res: Response) => {
|
||||
|
||||
let user = await UserService.checkSession(sessionId, sessionKey, ip);
|
||||
|
||||
if (!user.is_active) {
|
||||
if (!user.isActive) {
|
||||
res.status(403).send({'message': 'You do not have access to the specified calendar.'});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user