Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit c148b7d

Browse files
feat: slightly tweaking the body that is returned by the post request where next token and search params are not their own separat key value pairs but in the same body
1 parent 35c8f53 commit c148b7d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/stapi_fastapi/routers/product_router.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ async def search_opportunities(
177177
):
178178
case Success((features, Some(pagination_token))):
179179
links.append(self.order_link(request, "create-order"))
180+
body = search.model_dump()
181+
body["next"] = pagination_token
180182
links.append(
181183
Link(
182184
href=str(
@@ -185,7 +187,7 @@ async def search_opportunities(
185187
rel="next",
186188
type=TYPE_JSON,
187189
method="POST",
188-
body={"next": pagination_token, "search": search},
190+
body=body,
189191
)
190192
)
191193
case Success((features, Nothing)): # noqa: F841

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def pagination_tester(
196196
(d["href"] for d in resp_body["links"] if d["rel"] == "next"), None
197197
)
198198
body = next(
199-
(d.get("body")["search"] for d in resp_body["links"] if d.get("body")),
199+
(d.get("body") for d in resp_body["links"] if d.get("body")),
200200
None,
201201
)
202202
else:

0 commit comments

Comments
 (0)