ticket generation working

This commit is contained in:
2023-08-06 18:37:21 +02:00
parent 2812ab9055
commit 32ed36b93f
26 changed files with 594 additions and 96 deletions

View File

@@ -31,7 +31,7 @@ module.exports = ( app ) => {
}
} );
app.post( '/admin/API/:call', bodyParser.json(), ( req, res ) => {
app.post( '/admin/API/:call', bodyParser.json( { limit: '20mb' } ), ( req, res ) => {
if ( req.session.loggedInAdmin ) {
postHandler.handleCall( req.params.call, req.body, req.query.lang ).then( data => {
res.send( data );

View File

@@ -54,6 +54,12 @@ class POSTHandler {
} ).catch( error => {
reject( { 'code': 500, 'error': error } );
} );
} else if ( call === 'saveTickets' ) {
db.writeJSONDataSimple( 'tickets', data.location, data.data ).then( resp => {
resolve( resp );
} ).catch( error => {
reject( { 'code': 500, 'error': error } );
} );
} else {
reject( { 'code': 404, 'error': 'Route not found' } );
}