Skip to content

Commit 134198d

Browse files
committed
support 'take' param with invention searching
1 parent a1f5834 commit 134198d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "recnetpy"
7-
version = "0.1.41"
7+
version = "0.1.42"
88
authors = [
99
{ name="RecNetBot Development"}
1010
]

src/recnetpy/managers/invention_manager.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async def fetch(self, id: int) -> Optional['Invention']:
2525
return None
2626

2727

28-
async def search(self, query: str) -> List['Invention']:
28+
async def search(self, query: str, take: int = 16) -> List['Invention']:
2929
"""
3030
Searches RecNet for inventions based on a query, and returns
3131
a list of invention objects.
@@ -34,7 +34,11 @@ async def search(self, query: str) -> List['Invention']:
3434
:param query: A search query string.
3535
:return: A list of invention objects.
3636
"""
37-
data: Response[List[InventionResponse]] = await self.rec_net.api.inventions.v2.search.make_request('get', params = {'value': str(query)})
37+
params = {
38+
'value': str(query),
39+
'take': take
40+
}
41+
data: Response[List[InventionResponse]] = await self.rec_net.api.inventions.v2.search.make_request('get', params = params)
3842
return self.create_from_data_list(data.data)
3943

4044
async def featured(self, take: int = 16, skip: int = 0) -> List['Invention']:

0 commit comments

Comments
 (0)