refactor(pages): migrate app data reads to api adapters
This commit is contained in:
@@ -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("")
|
||||
|
||||
Reference in New Issue
Block a user