Repository navigation
fix(api): implement /api/v1/markets/{market_id}/cancel route and integrate cancel page - #1817
Merged
hman38705 merged 1 commit intoOct 20, 2026
Conversation
…and client integration - Added POST /api/v1/markets/:market_id/cancel route and cancel_market handler in services/api - Added cancel_market method in Database and InvalidationTag::MarketCancelled in RedisCache - Registered cancelMarket endpoint in services/api/openapi.yaml and openapi_spec.rs - Updated admin_routes, audit_middleware, and openapi_contract_test with cancelMarket - Added cancelMarket method in frontend admin-client.ts and generated schema in schema.d.ts - Connected CancelMarketPage to typed admin-client cancelMarket method with contract error handling - Added unit and contract tests in services/api and frontend/src/lib/api/__tests__ - Updated API_SPEC.md documentation Closes solutions-plug#1754
|
@shemaiahdelia03-cmd Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1754
Summary
Implements the missing backend route
POST /api/v1/markets/{market_id}/canceland integrates it with the typed frontend admin client and cancellation page.Changes
services/api):POST /api/v1/markets/:market_id/cancelinservices/api/src/main.rsunderadmin_routes.cancel_markethandler inservices/api/src/handlers.rswith utoipa OpenAPI annotations.cancel_marketmethod inservices/api/src/db.rsto transition active markets to cancelled status.InvalidationTag::MarketCancelledinservices/api/src/cache/mod.rsto invalidate market and statistics caches upon cancellation.cancel_marketinservices/api/src/audit_middleware.rs.cancelMarketpath and operation inservices/api/openapi.yaml,openapi_spec.rs, andservices/api/tests/openapi_contract_test.rs.services/api/src/cancel_market_tests.rs.frontend):frontend/src/lib/api/schema.d.tswithcancelMarketpath and operation.cancelMarketinfrontend/src/lib/api/admin-client.ts.CancelMarketPage(frontend/src/app/markets/[marketId]/cancel/page.tsx) to use typedapi.cancelMarket(marketId)with contract error handling.frontend/src/lib/api/__tests__/forcancelMarket.docs/API_SPEC.mdwithcancelMarketunder Admin Routes.