def reserve_resource(self, rid, status, form): dao = ResourceDetailsDAO() result = dao.updateAvailability(rid, status) transactionHandler = TransactionHandler() transactionHandler.insertTransaction(form, rid) return jsonify(Reserved=result)
def purchase_resource(self, rid, status, form): dao = ResourceDetailsDAO() # Adding compatibility with transaction transactionHandler = TransactionHandler() transactionHandler.insertTransaction(form, rid) result = dao.updateAvailability(rid, status) return jsonify(Reserved=result)