From 38ff65d51f3c2bd7d63945aa23108164914250a3 Mon Sep 17 00:00:00 2001 From: zetaloop Date: Sun, 3 May 2026 05:58:47 +0800 Subject: [PATCH] refactor: drop Number() coercion on snowflake ids --- lib/api/orders.ts | 12 ++++++------ lib/api/services.ts | 2 +- lib/api/shops.ts | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/api/orders.ts b/lib/api/orders.ts index c07537b..383358b 100644 --- a/lib/api/orders.ts +++ b/lib/api/orders.ts @@ -80,18 +80,18 @@ export async function getOrderById(orderId: string): Promise } interface CreatePaidOrderInput { - playerId: string | number - serviceId: string | number - shopId?: string | number + playerId: string + serviceId: string + shopId?: string quantity: number note?: string } function createOrderJson(input: CreatePaidOrderInput) { return { - playerId: Number(input.playerId), - serviceId: Number(input.serviceId), - ...(input.shopId ? { shopId: Number(input.shopId) } : {}), + playerId: input.playerId, + serviceId: input.serviceId, + ...(input.shopId ? { shopId: input.shopId } : {}), quantity: input.quantity, ...(input.note ? { note: input.note } : {}), } diff --git a/lib/api/services.ts b/lib/api/services.ts index 9c730e8..c38a803 100644 --- a/lib/api/services.ts +++ b/lib/api/services.ts @@ -29,7 +29,7 @@ export type ServiceInput = { function serviceJson(input: ServiceInput) { return { - gameId: Number(input.gameId), + gameId: input.gameId, title: input.title, description: input.description, price: input.price, diff --git a/lib/api/shops.ts b/lib/api/shops.ts index d794228..6d4d417 100644 --- a/lib/api/shops.ts +++ b/lib/api/shops.ts @@ -174,7 +174,7 @@ export async function inviteShopPlayer(shopId: string, playerId: string): Promis await httpJson(`/api/v1/shops/${encodeURIComponent(shopId)}/invitations`, { method: "POST", json: { - playerId: Number(playerId), + playerId, }, }) }