Skip to content

Commit

Permalink
chore:Add TempCacheDataResponseViewSet and update CACHETEMPDATA usage
Browse files Browse the repository at this point in the history
Introduced a new viewset and router to handle data insertion from CACHETEMPDATA into the database. Added comments for better context and slightly updated the tempcache structure for clarity.
  • Loading branch information
hareshkainthdbt committed Dec 13, 2024
1 parent 2a657fc commit e202622
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fbr/tempcache.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# flake8: noqa


# Temp data
CACHETEMPDATA = [
{
"title": "Lough Neagh and Lower Bann Drainage and Navigation Act (Northern Ireland) 1955",
Expand Down
3 changes: 3 additions & 0 deletions fbr/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def publishers(self, request, *args, **kwargs):
)


# This viewset is used to insert data from CACHETEMPDATA into the database
class TempCacheDataResponseViewSet(viewsets.ViewSet):
@action(detail=False, methods=["get"], url_path="cache")
def read_cachetempdata(self, request, *args, **kwargs):
Expand Down Expand Up @@ -103,6 +104,8 @@ def read_cachetempdata(self, request, *args, **kwargs):

router.register(r"v1", DataResponseViewSet, basename="search")
router.register(r"v1/retrieve", PublishersViewSet, basename="publishers")

# This router is used to insert data from CACHETEMPDATA into the database
router.register(r"v1/temp", TempCacheDataResponseViewSet, basename="cache")


Expand Down

0 comments on commit e202622

Please sign in to comment.