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

Commit 32b97ab

Browse files
author
Phil Varner
committed
change create-order endpoint from .../order to .../orders to follow web API conventions
1 parent 3011357 commit 32b97ab

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ none
1313

1414
### Changed
1515

16-
none
16+
- Create Order endpoint from `.../order` to `.../orders`
1717

1818
### Deprecated
1919

src/stapi_fastapi/routers/product_router.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async def _create_order(
9191
]
9292

9393
self.add_api_route(
94-
path="/order",
94+
path="/orders",
9595
endpoint=_create_order,
9696
name=f"{self.root_router.name}:{self.product.id}:create-order",
9797
methods=["POST"],

tests/opportunity_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ def test_search_opportunities_response(
5858
except Exception as _:
5959
pytest.fail("response is not an opportunity collection")
6060

61-
assert_link(f"POST {url}", body, "create-order", f"/products/{product_id}/order")
61+
assert_link(f"POST {url}", body, "create-order", f"/products/{product_id}/orders")

tests/order_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def new_order_response(
4444
product_backend._allowed_payloads = create_order_allowed_payloads
4545

4646
res = stapi_client.post(
47-
f"products/{product_id}/order",
47+
f"products/{product_id}/orders",
4848
json=create_order_allowed_payloads[0].model_dump(),
4949
)
5050

tests/product_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_product_response_self_link(
3434
url, body, "order-parameters", f"/products/{product_id}/order-parameters"
3535
)
3636
assert_link(url, body, "opportunities", f"/products/{product_id}/opportunities")
37-
assert_link(url, body, "create-order", f"/products/{product_id}/order")
37+
assert_link(url, body, "create-order", f"/products/{product_id}/orders")
3838

3939

4040
@pytest.mark.parametrize("product_id", ["test-spotlight"])

0 commit comments

Comments
 (0)