Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/services/updateCoins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ import { z } from "zod"
import type { ComputedCharacter } from "./computeCharacter"

// Schema for coin delta - empty/null values default to 0
const CoinDelta = NumberField(
z
.number()
.int({ message: "Must be a whole number" })
.nullable()
.transform((v) => v ?? 0)
)
const CoinDelta = NumberField(z.number().int({ message: "Must be a whole number" }).nullable())

// Schema for the coin update API
export const UpdateCoinsApiSchema = z.object({
Expand Down
Loading