From e66b7aa19a31077f87a2bbf5e6401a7900c14286 Mon Sep 17 00:00:00 2001 From: TonyJabbour Date: Mon, 4 Oct 2021 15:31:18 +0200 Subject: [PATCH] Type fixed --- bin/packages/Item.py | 7 ++++--- var/www/modules/restApi/Flask_restApi.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/packages/Item.py b/bin/packages/Item.py index b20e51d2..8331a33a 100755 --- a/bin/packages/Item.py +++ b/bin/packages/Item.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # -*-coding:UTF-8 -* +import base64 import os import re import sys @@ -234,9 +235,9 @@ def get_item_as_txt(request_dict): return {'status': 'error', 'reason': 'Item not found'}, 404 item_content = get_item_content(item_id) - #encoded_item_content = item_content.encode("UTF-8") - #base64_output = base64.b64encode(encoded_item_content) - dict_item = {'id': item_id, 'content': item_content} + encoded_item_content = item_content.encode("UTF-8") + base64_output = base64.b64encode(encoded_item_content) + dict_item = {'id': item_id, 'content': base64_output} return dict_item, 200 diff --git a/var/www/modules/restApi/Flask_restApi.py b/var/www/modules/restApi/Flask_restApi.py index 4bed7193..6ba69f63 100644 --- a/var/www/modules/restApi/Flask_restApi.py +++ b/var/www/modules/restApi/Flask_restApi.py @@ -315,7 +315,7 @@ def get_item_content(): @restApi.route("api/v1/get/item/content/text", methods=['POST']) @token_required('read_only') -def get_item_content(): +def get_item_content_text(): data = request.get_json() item_id = data.get('id', None)