refactor: drop Number() coercion on snowflake ids
This commit is contained in:
+6
-6
@@ -80,18 +80,18 @@ export async function getOrderById(orderId: string): Promise<Order | undefined>
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface CreatePaidOrderInput {
|
interface CreatePaidOrderInput {
|
||||||
playerId: string | number
|
playerId: string
|
||||||
serviceId: string | number
|
serviceId: string
|
||||||
shopId?: string | number
|
shopId?: string
|
||||||
quantity: number
|
quantity: number
|
||||||
note?: string
|
note?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
function createOrderJson(input: CreatePaidOrderInput) {
|
function createOrderJson(input: CreatePaidOrderInput) {
|
||||||
return {
|
return {
|
||||||
playerId: Number(input.playerId),
|
playerId: input.playerId,
|
||||||
serviceId: Number(input.serviceId),
|
serviceId: input.serviceId,
|
||||||
...(input.shopId ? { shopId: Number(input.shopId) } : {}),
|
...(input.shopId ? { shopId: input.shopId } : {}),
|
||||||
quantity: input.quantity,
|
quantity: input.quantity,
|
||||||
...(input.note ? { note: input.note } : {}),
|
...(input.note ? { note: input.note } : {}),
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ export type ServiceInput = {
|
|||||||
|
|
||||||
function serviceJson(input: ServiceInput) {
|
function serviceJson(input: ServiceInput) {
|
||||||
return {
|
return {
|
||||||
gameId: Number(input.gameId),
|
gameId: input.gameId,
|
||||||
title: input.title,
|
title: input.title,
|
||||||
description: input.description,
|
description: input.description,
|
||||||
price: input.price,
|
price: input.price,
|
||||||
|
|||||||
+1
-1
@@ -174,7 +174,7 @@ export async function inviteShopPlayer(shopId: string, playerId: string): Promis
|
|||||||
await httpJson<unknown>(`/api/v1/shops/${encodeURIComponent(shopId)}/invitations`, {
|
await httpJson<unknown>(`/api/v1/shops/${encodeURIComponent(shopId)}/invitations`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
json: {
|
json: {
|
||||||
playerId: Number(playerId),
|
playerId,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user