mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 21:34:24 +00:00
implement first part of occupied seat counter
This commit is contained in:
@@ -76,6 +76,8 @@ class GETHandler {
|
||||
resolve( this.settings.currency );
|
||||
} else if ( call === 'getAdminAccounts' ) {
|
||||
// TODO: Finish
|
||||
} else if ( call === 'getPaymentGatewaySettings' ) {
|
||||
// TODO: Finish
|
||||
} else if ( call === 'getSettings' ) {
|
||||
resolve( this.settings );
|
||||
} else {
|
||||
|
||||
@@ -119,7 +119,13 @@ class POSTHandler {
|
||||
this.settings[ 'currency' ] = data.currency;
|
||||
this.settings[ 'payments' ] = data.payments;
|
||||
fs.writeFileSync( path.join( __dirname + '/../../config/settings.config.json' ), JSON.stringify( this.settings ) );
|
||||
// TODO: Parse all events and update currency
|
||||
db.getJSONData( 'events' ).then( dat => {
|
||||
let updated = dat;
|
||||
for ( let event in updated ) {
|
||||
updated[ event ][ 'currency' ] = data.currency;
|
||||
}
|
||||
db.writeJSONData( 'events', updated );
|
||||
} );
|
||||
resolve( 'ok' );
|
||||
} else {
|
||||
reject( { 'code': 404, 'error': 'Route not found' } );
|
||||
|
||||
Reference in New Issue
Block a user