refactor(orders): replace local state machine with minimal cache
Strip store/orders.ts to a thin local cache with setOrders and updateOrder only. Remove all client-side state transition logic, actor validation, chat sync, notification generation, and wallet integration — these are now handled by the backend API. Fix components/order-actions.tsx and stores that depended on the removed order store methods (markDisputed, autoTimeout*).
This commit is contained in:
@@ -108,11 +108,6 @@ export const useDisputeStore = create<DisputeState>((set, get) => {
|
||||
return { decision: deny(403, "仅订单参与方可发起争议") }
|
||||
}
|
||||
|
||||
const markResult = useOrderStore.getState().markDisputed(input.orderId, actor)
|
||||
if (!markResult.decision.ok) {
|
||||
return { decision: markResult.decision }
|
||||
}
|
||||
|
||||
const createdAt = new Date().toISOString()
|
||||
const dispute: DisputeRecord = {
|
||||
id: generateId("disp"),
|
||||
|
||||
Reference in New Issue
Block a user