Skip to content

Commit aedb1d7

Browse files
author
fakhri
committed
Adding new query parameter capability on getting_multiple_books method
1 parent 1880192 commit aedb1d7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

endpoints/books.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,12 @@ def getting_single_book(self, bookId) -> str:
1212
self._endpoint_url += bookId
1313
return self._send_get_requests()
1414

15-
def getting_multiple_books(self):
15+
def getting_multiple_books(self, type="", limit=""):
16+
if (type != "") and (limit == ""):
17+
self._endpoint_url += f"?type={type}"
18+
elif (type == "") and (limit != ""):
19+
self._endpoint_url += f"?limit={limit}"
20+
elif (type != "") and (type != ""):
21+
self._endpoint_url += f"?type={type}&limit={limit}"
22+
1623
return self._send_get_requests()

0 commit comments

Comments
 (0)