URLs in API responses have full URL

This commit is contained in:
Paul Craig
2016-11-28 11:13:11 +00:00
parent 268e19bb76
commit 9b1375ba84
3 changed files with 18 additions and 12 deletions

View File

@@ -29,12 +29,12 @@ def get_notifications():
def _build_links(notifications):
_links = {
'current': url_for(".get_notifications", **request.args.to_dict(flat=False)),
'current': url_for(".get_notifications", _external=True, **request.args.to_dict(flat=False)),
}
if len(notifications):
next_query_params = dict(request.args.to_dict(flat=False), older_than=notifications[-1].id)
_links['next'] = url_for(".get_notifications", **next_query_params)
_links['next'] = url_for(".get_notifications", _external=True, **next_query_params)
return _links