feat(orders): migrate orders to backend API

This commit is contained in:
zetaloop
2026-02-28 18:13:42 +08:00
parent e94a7e68ff
commit 9739c94bdc
9 changed files with 263 additions and 130 deletions
+8 -6
View File
@@ -3,14 +3,16 @@ import { useAuthStore } from "@/store/auth"
import { describe, expect, it } from "vitest"
describe("lib/api/orders", () => {
it("returns { decision: { ok:false, error:{code,msg} } } when unauthenticated", () => {
it("returns { decision: { ok:false, error:{code,msg} } } when unauthenticated", async () => {
useAuthStore.getState().logout()
const res = createPaidOrder({
playerId: "1005",
serviceId: "5001",
quantity: 1,
})
const res = await Promise.resolve(
createPaidOrder({
playerId: "1005",
serviceId: "5001",
quantity: 1,
}),
)
expect(res).toEqual({
decision: {