Skip to content

Commit

Permalink
fix: Rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Aug 2, 2024
1 parent 691aade commit a7184d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
16 changes: 5 additions & 11 deletions app/api/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,23 +192,17 @@ export async function POST(req: Request) {
console.log({ gasBillYearly });

return NextResponse.json({
postcode,
houseType: data.houseType,
houseAge: data.houseAge ? parseFloat(data.houseAge.toString()) : null,
houseBedrooms: data.houseBedrooms
? parseFloat(data.houseBedrooms.toString())
: null,
houseSize: data.houseSize
? parseFloat(data.houseSize.toString())
: null,
postcode: input.housePostcode,
houseType: input.houseType,
houseAge: input.houseAge,
houseBedrooms: input.houseBedrooms,
houseSize: input.houseSize,
averagePrice: parseFloat(averagePrice.toFixed(2)),
itl3,
gdhi,
hpi: averageHpi,
buildPrice,
averageRent,
socialRentAdjustments,
socialRentAveEarning,
numberOfTransactions,
granularityPostcode,
pricesPaid,
Expand Down
2 changes: 1 addition & 1 deletion app/schemas/calculationSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const calculationSchema = z.object({
.min(1, "housePostcode is required")
.refine(fixPostcode, "Invalid postcode")
.transform(parsePostcode)
.refine((postcode) => postcode.valid),
.refine((postcode) => postcode.valid, { message: "Invalid postcode" }),
houseSize: z.coerce.number().positive("houseSize must be a positive integer"),
houseAge: z.coerce.number().positive("houseAge must be a positive integer"),
houseBedrooms: z.coerce
Expand Down

0 comments on commit a7184d6

Please sign in to comment.