refactor(pages): migrate app data reads to api adapters

This commit is contained in:
zetaloop
2026-02-22 08:30:21 +08:00
parent 43a0cf7a73
commit 4beb610f23
13 changed files with 97 additions and 66 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Separator } from "@/components/ui/separator"
import { Textarea } from "@/components/ui/textarea"
import { mockPlayers, mockServices } from "@/lib/mock"
import { getPlayerById, getServiceById } from "@/lib/api"
import { notifySuccess } from "@/lib/toast"
import { useRequireAuth } from "@/lib/use-require-auth"
import { useAuthStore } from "@/store/auth"
@@ -29,8 +29,8 @@ export default function NewOrderPage() {
const deductBalance = useWalletStore((state) => state.deductBalance)
const serviceId = searchParams.get("serviceId")
const service = mockServices.find((s) => s.id === serviceId)
const player = service ? mockPlayers.find((p) => p.id === service.playerId) : null
const service = serviceId ? getServiceById(serviceId) : undefined
const player = service ? getPlayerById(service.playerId) : undefined
const [quantity, setQuantity] = useState(1)
const [note, setNote] = useState("")