Skip to content

Commit

Permalink
Add endpoint for recent nodes page
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah256 authored and mprahl committed Feb 18, 2019
1 parent ff351ad commit 9dc7339
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions estuary/api/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from estuary.models.base import EstuaryStructuredNode

from estuary.utils.general import str_to_bool, get_neo4j_node, inflate_node, login_required
from estuary.utils.recents import get_recent_nodes
from estuary.error import ValidationError
import estuary.utils.story

Expand Down Expand Up @@ -339,3 +340,16 @@ def get_artifact_relationships(resource, uid, relationship):
results['data'].append(serialized_node)

return jsonify(results)


@api_v1.route('/recents')
@login_required
def get_recent_stories():
"""Get stories that were most recently updated, by their artifact type."""
nodes = get_recent_nodes()
result = {
'data': nodes,
'metadata': {}
}

return jsonify(result)

0 comments on commit 9dc7339

Please sign in to comment.