diff --git a/geruecht/controller/databaseController/dbPricelistController.py b/geruecht/controller/databaseController/dbPricelistController.py index 7d00117..11f23d1 100644 --- a/geruecht/controller/databaseController/dbPricelistController.py +++ b/geruecht/controller/databaseController/dbPricelistController.py @@ -11,7 +11,7 @@ class Base: retVal = cursor.fetchall() for data in retVal: data['drink_type'] = self.getDrinkType(data['type']) - return cursor.fetchall() + return retVal except Exception as err: traceback.print_exc() self.db.connection.rollback() diff --git a/geruecht/controller/mainController/mainFreeDrinkListConfigController.py b/geruecht/controller/mainController/mainFreeDrinkListConfigController.py index 3c999ad..ac271e5 100644 --- a/geruecht/controller/mainController/mainFreeDrinkListConfigController.py +++ b/geruecht/controller/mainController/mainFreeDrinkListConfigController.py @@ -25,4 +25,7 @@ class Base: return db.get_free_drink_list_history_by_user(user) def get_free_drink_list_reasons(self): - return db.get_free_drink_list_reasons() \ No newline at end of file + return db.get_free_drink_list_reasons() + + def get_free_drink_types(self): + return db.get_free_drink_list_types() \ No newline at end of file diff --git a/geruecht/routes.py b/geruecht/routes.py index 3135f70..2208f94 100644 --- a/geruecht/routes.py +++ b/geruecht/routes.py @@ -81,6 +81,17 @@ def _free_drink_list_reasons(**kwargs): debug.warning("exception in delete free_dirnk_list_reasons.", exc_info=True) 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']) def _getPricelist(): try: