Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move $POST/fetch => $POST/reindex #124

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions history4feed/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def __init__(self, status, title, details=None):
summary="Delete a Post by ID",
description="This will delete the post inside of the feed. Deleting the post will remove it forever and it will not be reindexed on subsequent feed updates. The only way to re-index it is to add it manually.",
),
fetch=extend_schema(
reindex=extend_schema(
summary="Update a Post in a Feed",
description=textwrap.dedent(
"""
Expand Down Expand Up @@ -208,7 +208,7 @@ def partial_update(self, request, *args, **kwargs):
return Response(s.data, status=status.HTTP_201_CREATED)

@decorators.action(detail=True, methods=['PATCH'])
def fetch(self, request, *args, **kwargs):
def reindex(self, request, *args, **kwargs):
s = PatchSerializer(data=request.data)
s.is_valid(raise_exception=True)
post: Post = self.get_object()
Expand Down Expand Up @@ -627,8 +627,8 @@ def create(self, request, *args, feed_id=None, **kwargs):
},
request={},
)
@decorators.action(methods=["PATCH"], detail=False)
def reindex(self, request, *args, feed_id=None, **kwargs):
@decorators.action(methods=["PATCH"], detail=False, url_path='reindex')
def reindex_feed(self, request, *args, feed_id=None, **kwargs):
posts = self.get_queryset().all()
feed_obj = get_object_or_404(Feed, id=feed_id)

Expand Down
Loading