mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 21:34:24 +00:00
ticket generation working
This commit is contained in:
@@ -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 );
|
||||
|
||||
@@ -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' } );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user