feat(admin): validate and cancel co-load groups

This commit is contained in:
2026-08-31 14:54:57 +08:00
parent dc1027804e
commit cd290b8dc6
5 changed files with 149 additions and 17 deletions
@@ -81,10 +81,10 @@ export async function createPlatformCoLoadGroup(orderIds: string[]) {
return normalizeGroup(unwrapApiResponse(response))
}
export async function cancelPlatformCoLoadGroup(groupId: string, expectedVersion: number, reason?: string | null) {
export async function cancelPlatformCoLoadGroup(inboundCode: string, reason?: string | null) {
const response = await http.post<ApiEnvelope<RawCoLoadGroup>, ApiEnvelope<RawCoLoadGroup>>(
`${basePath}/${encodeURIComponent(groupId)}/cancel`,
{ expectedVersion, reason: reason?.trim() || null },
`${basePath}/by-inbound-code/${encodeURIComponent(inboundCode)}/cancel`,
{ reason: reason?.trim() || null },
{ headers: { 'Idempotency-Key': operationId('admin-coload-cancel') } },
)
return normalizeGroup(unwrapApiResponse(response))