diff --git a/tildes/openapi_beta.yaml b/tildes/openapi_beta.yaml index 3c18065..27116c4 100644 --- a/tildes/openapi_beta.yaml +++ b/tildes/openapi_beta.yaml @@ -274,7 +274,7 @@ components: - ignored - official - tags - - last_visit_time + - last_visited_at properties: id: type: string @@ -326,7 +326,7 @@ components: type: array items: type: string - last_visit_time: + last_visited_at: type: string nullable: true @@ -339,7 +339,7 @@ components: - rendered_html - created_at - edited_at - - votes + - vote_count - removed - deleted - exemplary @@ -366,7 +366,7 @@ components: edited_at: type: string nullable: true - votes: + vote_count: type: integer removed: type: boolean @@ -410,11 +410,11 @@ components: Pagination: type: object required: - - num_items + - item_count - next_link - prev_link properties: - num_items: + item_count: type: integer description: The number of items returned in this response. next_link: diff --git a/tildes/tildes/views/api/beta/comment.py b/tildes/tildes/views/api/beta/comment.py index 54507f1..c3c1773 100644 --- a/tildes/tildes/views/api/beta/comment.py +++ b/tildes/tildes/views/api/beta/comment.py @@ -31,7 +31,7 @@ def comment_to_api_dict(request: Request, comment: Comment) -> dict: created_time = None edited_time = None rendered_html = None - votes = 0 + vote_count = 0 exemplary = None by_op = None by_me = None @@ -46,7 +46,7 @@ def comment_to_api_dict(request: Request, comment: Comment) -> dict: comment.last_edited_time.isoformat() if comment.last_edited_time else None ) rendered_html = comment.rendered_html - votes = comment.num_votes + vote_count = comment.num_votes exemplary = comment.is_label_active("exemplary") by_me = request.user == comment.user if request.user else False @@ -75,7 +75,7 @@ def comment_to_api_dict(request: Request, comment: Comment) -> dict: "rendered_html": rendered_html, "created_at": created_time, "edited_at": edited_time, - "votes": votes, + "vote_count": vote_count, "removed": is_removed, "deleted": is_deleted, "exemplary": exemplary, diff --git a/tildes/tildes/views/api/beta/topic.py b/tildes/tildes/views/api/beta/topic.py index 6b04bc8..0da2e87 100644 --- a/tildes/tildes/views/api/beta/topic.py +++ b/tildes/tildes/views/api/beta/topic.py @@ -44,7 +44,7 @@ def topic_to_api_dict(topic: Topic) -> dict: "ignored": topic.user_ignored, "official": topic.is_official, "tags": topic.tags, - "last_visit_time": ( + "last_visited_at": ( topic.last_visit_time.isoformat() if topic.last_visit_time else None ), } @@ -109,7 +109,7 @@ def get_topics(request: Request) -> dict: # noqa response = { "topics": processed_topics, "pagination": { - "num_items": len(processed_topics), + "item_count": len(processed_topics), "next_link": next_link, "prev_link": prev_link, }, diff --git a/tildes/tildes/views/api/beta/user.py b/tildes/tildes/views/api/beta/user.py index 0f97ea1..23b0ffa 100644 --- a/tildes/tildes/views/api/beta/user.py +++ b/tildes/tildes/views/api/beta/user.py @@ -100,7 +100,7 @@ def get_user(request: Request) -> dict: # noqa "user": _user_to_api_dict(user), "history": processed_results, "pagination": { - "num_items": len(processed_results), + "item_count": len(processed_results), "next_link": next_link, "prev_link": prev_link, }, @@ -156,7 +156,7 @@ def get_user_comments(request: Request) -> dict: response = { "comments": processed_comments, "pagination": { - "num_items": len(processed_comments), + "item_count": len(processed_comments), "next_link": next_link, "prev_link": prev_link, }, @@ -212,7 +212,7 @@ def get_user_topics(request: Request) -> dict: response = { "topics": processed_topics, "pagination": { - "num_items": len(processed_topics), + "item_count": len(processed_topics), "next_link": next_link, "prev_link": prev_link, },