diff --git a/geruecht/finanzer/routes.py b/geruecht/finanzer/routes.py index 9363617..a7cb678 100644 --- a/geruecht/finanzer/routes.py +++ b/geruecht/finanzer/routes.py @@ -69,7 +69,8 @@ def _addAmount(): LOGGER.error("KeyError in month. Month is set to default.") month = datetime.now().month LOGGER.debug("Year is {} and Month is {}".format(year, month)) - retVal = userController.addAmount(userID, amount, year=year, month=month).toJSON() + userController.addAmount(userID, amount, year=year, month=month) + retVal = {geruecht.year: geruecht.toJSON() for geruecht in userController.getUser(userID).geruechte} LOGGER.info("Send updated Geruecht") return jsonify(retVal) LOGGER.info("Permission Denied") @@ -114,6 +115,7 @@ def _addCredit(): LOGGER.debug("Year is {} and Month is {}".format(year, month)) retVal = userController.addCredit(userID, credit, year=year, month=month).toJSON() + retVal = {geruecht.year: geruecht.toJSON() for geruecht in userController.getUser(userID).geruechte} LOGGER.info("Send updated Geruecht") return jsonify(retVal) LOGGER.info("Permission Denied")