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:
parent
4a69d54660
commit
2f2fdacca2
|
@ -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()
|
||||||
|
|
|
@ -25,4 +25,7 @@ class Base:
|
||||||
return db.get_free_drink_list_history_by_user(user)
|
return db.get_free_drink_list_history_by_user(user)
|
||||||
|
|
||||||
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()
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue