Commit a8cb9a99 authored by Ilham Maulana's avatar Ilham Maulana 💻

fix: image url payload

parent 951a02a1
...@@ -31,10 +31,7 @@ def bookView(request): ...@@ -31,10 +31,7 @@ def bookView(request):
"title": book_item.title, "title": book_item.title,
"author": book_item.author, "author": book_item.author,
"description": book_item.description, "description": book_item.description,
"cover_image": "http://" "cover_image": host_name + book_item.cover_image.url,
+ host_name
+ ":8000"
+ book_item.cover_image.url,
"category": { "category": {
"name": book_item.category.name, "name": book_item.category.name,
}, },
...@@ -45,10 +42,7 @@ def bookView(request): ...@@ -45,10 +42,7 @@ def bookView(request):
"title": book_item.title, "title": book_item.title,
"author": book_item.author, "author": book_item.author,
"description": book_item.description, "description": book_item.description,
"cover_image": "http://" "cover_image": host_name + book_item.cover_image.url,
+ host_name
+ ":8000"
+ book_item.cover_image.url,
} }
data.append(book) data.append(book)
......
host_name = "127.0.0.1" host_name = "https://ilhammaulana.pythonanywhere.com"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment