refactor(store): adapt Zustand stores to backend-aligned types
- orders: remove name fields from creation, keep dispatchMode logic - chat: remove readonly/senderName/senderAvatar references - reviews: remove fromUserAvatar/toUserId, simplify participant check - disputes: remove initiatorId/initiatorName from creation - posts: remove authorRole/quotedPostId, keep linkedOrderId as number - comments: remove postId from creation - wallet: use string amounts
This commit is contained in:
+5
-5
@@ -27,7 +27,7 @@ export const useWalletStore = create<WalletState>((set, get) => ({
|
||||
{
|
||||
id: generateId("tx"),
|
||||
type: "topup",
|
||||
amount,
|
||||
amount: String(amount),
|
||||
description: "充值",
|
||||
createdAt: now,
|
||||
},
|
||||
@@ -43,7 +43,7 @@ export const useWalletStore = create<WalletState>((set, get) => ({
|
||||
{
|
||||
id: generateId("tx"),
|
||||
type: "withdrawal",
|
||||
amount: -amount,
|
||||
amount: String(-amount),
|
||||
description: "提现到银行卡",
|
||||
createdAt: now,
|
||||
},
|
||||
@@ -69,7 +69,7 @@ export const useWalletStore = create<WalletState>((set, get) => ({
|
||||
{
|
||||
id: generateId("tx"),
|
||||
type: "payment",
|
||||
amount: -amount,
|
||||
amount: String(-amount),
|
||||
description: `支付订单 ${orderId}`,
|
||||
createdAt: now,
|
||||
},
|
||||
@@ -100,7 +100,7 @@ export const useWalletStore = create<WalletState>((set, get) => ({
|
||||
{
|
||||
id: generateId("tx"),
|
||||
type: "refund",
|
||||
amount,
|
||||
amount: String(amount),
|
||||
description: `订单 ${orderId} 退款`,
|
||||
createdAt: now,
|
||||
},
|
||||
@@ -130,7 +130,7 @@ export const useWalletStore = create<WalletState>((set, get) => ({
|
||||
{
|
||||
id: generateId("tx"),
|
||||
type: "income",
|
||||
amount: income,
|
||||
amount: String(income),
|
||||
description: `订单 ${orderId} 收入(${commissionLabel})`,
|
||||
createdAt: now,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user