Get FreeDrinkTypes und Bugfix

Alle Freigetränktypen können nun geladen werden.
Es wurde ein Bug gefixed, sodass die Preisliste wieder geladen werden kann.
This commit is contained in:
Tim Gröger 2020-08-21 21:59:39 +02:00
parent 4a69d54660
commit 2f2fdacca2
3 changed files with 16 additions and 2 deletions

View File

@ -11,7 +11,7 @@ class Base:
retVal = cursor.fetchall() retVal = cursor.fetchall()
for data in retVal: for data in retVal:
data['drink_type'] = self.getDrinkType(data['type']) data['drink_type'] = self.getDrinkType(data['type'])
return cursor.fetchall() return retVal
except Exception as err: except Exception as err:
traceback.print_exc() traceback.print_exc()
self.db.connection.rollback() self.db.connection.rollback()

View File

@ -26,3 +26,6 @@ class Base:
def get_free_drink_list_reasons(self): def get_free_drink_list_reasons(self):
return db.get_free_drink_list_reasons() return db.get_free_drink_list_reasons()
def get_free_drink_types(self):
return db.get_free_drink_list_types()

View File

@ -81,6 +81,17 @@ def _free_drink_list_reasons(**kwargs):
debug.warning("exception in delete free_dirnk_list_reasons.", exc_info=True) debug.warning("exception in delete free_dirnk_list_reasons.", exc_info=True)
return jsonify({"error": str(err)}), 500 return jsonify({"error": str(err)}), 500
@app.route("/freeDrinkTypes", methods=['GET', 'POST'])
@login_required()
def _free_drink_types(**kwargs):
try:
debug.info("get free_drnik_types")
retVal = mainController.get_free_drink_types()
return jsonify(retVal)
except Exception as err:
debug.warning("exception in free_dirnk_types.", exc_info=True)
return jsonify({"error": str(err)}), 500
@app.route("/pricelist", methods=['GET']) @app.route("/pricelist", methods=['GET'])
def _getPricelist(): def _getPricelist():
try: try: