working location settings (incl saving)

This commit is contained in:
2023-07-24 15:44:24 +02:00
parent 5e5e7fee49
commit 84c0017e2a
9 changed files with 167 additions and 121 deletions

View File

@@ -21,10 +21,10 @@ class GETHandler {
if ( Object.keys( data ).length > 0 ) {
resolve( data[ 'save' ] );
} else {
reject( 'No data found for this location' );
reject( { 'code': 400, 'error': 'No data found for this location' } );
}
} ).catch( error => {
reject( error );
reject( { 'code': 500, 'error': error } );
} );
} else if ( call === 'getSeatplanDraft' ) {
db.getJSONDataSimple( 'seatplan', query.location ).then( data => {
@@ -35,11 +35,19 @@ class GETHandler {
resolve( data[ 'save' ] );
}
} else {
reject( 'No data found for this location' );
reject( { 'code': 400, 'error': 'No data found for this location' } );
}
} ).catch( error => {
reject( error );
} );
} else if ( call === 'getLocations' ) {
db.getJSONData( 'locations' ).then( data => {
resolve( data );
} ).catch( error => {
reject( { 'code': 500, 'error': error } );
} );
} else {
reject( { 'code': 404, 'error': 'Route not found' } );
}
} );
}