implement first part of occupied seat counter

This commit is contained in:
2023-08-18 18:13:53 +02:00
parent 4208ad44a2
commit 6051b18796
8 changed files with 44 additions and 23 deletions

View File

@@ -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 {

View File

@@ -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' } );