refactor(pages): migrate app data reads to api adapters
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table"
|
||||
import { mockTransactions } from "@/lib/mock"
|
||||
import { listTransactions } from "@/lib/api"
|
||||
import { useAuthStore } from "@/store/auth"
|
||||
import { useOrderStore } from "@/store/orders"
|
||||
import { useShopStore } from "@/store/shops"
|
||||
@@ -35,7 +35,7 @@ export default function ShopIncomePage() {
|
||||
.reduce((acc, order) => acc + order.totalPrice, 0)
|
||||
|
||||
const shopOrderIds = new Set(shopOrders.map((order) => order.id))
|
||||
const relatedTransactions = mockTransactions.filter((transaction) => {
|
||||
const relatedTransactions = listTransactions().filter((transaction) => {
|
||||
if (transaction.type === "withdrawal") return true
|
||||
if (transaction.type !== "income") return false
|
||||
const match = transaction.description.match(/ord\d+/)
|
||||
|
||||
Reference in New Issue
Block a user