git add . is a difficult command to execute
Jenkins Production Deployment

This commit is contained in:
2022-12-25 15:43:37 +01:00
parent 83c9d090e1
commit a8f7189cb3
2 changed files with 80 additions and 6 deletions
+53 -1
View File
@@ -194,8 +194,60 @@ eventsRouter.put('/:eventId', async (req: Request, res: Response) => {
let success = await EventService.updateEvent(event);
if (success) {
res.status(200).send({'message': 'Event was successfully updated'});
} else {
res.status(500).send({'message': 'An error occurred during the update process. Please try again.'});
}
} catch (e: any) {
let errorGuid = Guid.create().toString();
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
res.status(500).send({
'status': 'PROCESSING_ERROR',
'message': 'Internal Server Error. Try again later.',
'reference': errorGuid
});
}
});
res.status(200).send({'message': 'Event was successfully updated'});
eventsRouter.delete('/:eventId', async (req: Request, res: Response) => {
try {
// Get params
let password = req.body.password;
if (!CredentialService.checkAdminPrivileges(password)) {
res.status(403).send({'message': 'Insufficient privileges.'});
return;
}
if (
req.params.eventId === undefined
) {
res.status(401).send({'message': 'Required parameters missing'});
return;
}
let event: Event = {
event_id: parseInt(req.params.eventId, 10),
calendar_id: -1,
uuid: '',
name: '',
description: '',
start_datetime: new Date(),
end_datetime: new Date(),
created_date: new Date(),
location: '',
created_by: '',
url: ''
};
let success = await EventService.deleteEvent(event);
if (success) {
res.status(200).send({'message': 'Event was successfully updated'});
} else {
res.status(500).send({'message': 'An error occurred during deletion. Please try again.'});
}
} catch (e: any) {
let errorGuid = Guid.create().toString();
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});