Fixed API refresh showing as failed due to incorrect response formatting.
This commit is contained in:
parent
c655bad631
commit
60bc7483b2
@ -134,10 +134,12 @@ $("#get-help").click (e) ->
|
||||
$("#api-refresh").click (e) ->
|
||||
e.preventDefault();
|
||||
$("#api-refresh").find('img').addClass('glyphicon-spin');
|
||||
$.post("/refresh").success(() ->
|
||||
$.post("/refresh").success((retData) ->
|
||||
refreshQuestion();
|
||||
$("#api-refresh").find('img').removeClass('glyphicon-spin');
|
||||
$("#api-refresh").attr('data-original-title', "Last API Refresh:<br>" + retData.last_refresh + "<br>Click to refresh");
|
||||
$('#success-area').show();
|
||||
|
||||
).fail(() ->
|
||||
$('#error-area').show();
|
||||
$('#error-text').text("Cannot refresh API. Try again later.")
|
||||
|
@ -242,7 +242,7 @@ def get_items():
|
||||
def refresh_api(): # pragma: no cover
|
||||
try:
|
||||
current_user.update_all()
|
||||
return str(datetime_format(current_user.last_updated)), 202
|
||||
return flask.jsonify(last_refresh=datetime_format(current_user.last_updated))
|
||||
except ValueError as err:
|
||||
logger.error("Error during /refresh. %s", str(err))
|
||||
return str(err), 500
|
||||
|
Loading…
Reference in New Issue
Block a user