fix: dev: api

This commit is contained in:
rachmadaniHaryono 2019-05-14 04:56:25 +08:00
parent de395789b5
commit 8d1cc65f69

View File

@ -184,14 +184,11 @@ def bookmarks():
create_bookmarks_form.tags.data, create_bookmarks_form.tags.data,
create_bookmarks_form.description.data create_bookmarks_form.description.data
) )
if request.path.startswith('/api/'): if request.path.startswith('/api/') and result_flag != -1:
res = [ res = jsonify(response.response_template['success'])
jsonify(response.response_template['success']), status.HTTP_200_OK, elif request.path.startswith('/api/') and result_flag == -1:
{'ContentType': 'application/json'} res = jsonify(response.response_template['failure'])
] if result_flag != -1 else [ res.status_code = status.HTTP_400_BAD_REQUEST
jsonify(response.response_template['failure']), status.HTTP_400_BAD_REQUEST,
{'ContentType': 'application/json'}
]
else: else:
bm_text = '[<a href="{0}">{0}</a>]'.format(url_data) bm_text = '[<a href="{0}">{0}</a>]'.format(url_data)
if result_flag != -1: if result_flag != -1: