Skip to content

Commit

Permalink
wip: bs-194 - list API done
Browse files Browse the repository at this point in the history
  • Loading branch information
rkshaon committed Jan 16, 2025
1 parent 3c9539b commit 8a87a1e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/book_api/views/v1/book.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ class BookViewSet(ModelViewSet):
filter_backends = [SearchFilter]
search_fields = ['title']

def list(self, request, *args, **kwargs):
"""Log the event when retrieving a list of items."""
response = super().list(request, *args, **kwargs)
event_logger(
event='retrieve',
object='book',
user=request.user,
device=request.device,
ip_address=request.ip_address,
)

return response



Expand Down

0 comments on commit 8a87a1e

Please sign in to comment.