refactor: drop Number() coercion on snowflake ids

This commit is contained in:
zetaloop
2026-05-03 05:58:47 +08:00
parent 88eb9727b5
commit 38ff65d51f
3 changed files with 8 additions and 8 deletions
+6 -6
View File
@@ -80,18 +80,18 @@ export async function getOrderById(orderId: string): Promise<Order | undefined>
}
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 } : {}),
}
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -174,7 +174,7 @@ export async function inviteShopPlayer(shopId: string, playerId: string): Promis
await httpJson<unknown>(`/api/v1/shops/${encodeURIComponent(shopId)}/invitations`, {
method: "POST",
json: {
playerId: Number(playerId),
playerId,
},
})
}