Merged in fix/previous-data-throwing (pull request #200)
Fix: missing previous data throwing error Approved-by: Michael Zetterberg
This commit is contained in:
@@ -13,7 +13,7 @@ export default function ShowMoreButton({
|
|||||||
<Button
|
<Button
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
intent="primary"
|
intent="primary"
|
||||||
theme="secondaryDark"
|
theme="primaryDark"
|
||||||
type="button"
|
type="button"
|
||||||
onClick={loadMoreData}
|
onClick={loadMoreData}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export const getUserSchema = z.object({
|
|||||||
streetAddress: z.string().optional(),
|
streetAddress: z.string().optional(),
|
||||||
zipCode: z.string(),
|
zipCode: z.string(),
|
||||||
}),
|
}),
|
||||||
dateOfBirth: z.string(),
|
dateOfBirth: z.string().optional().default("N/A"),
|
||||||
email: z.string().email(),
|
email: z.string().email(),
|
||||||
firstName: z.string(),
|
firstName: z.string(),
|
||||||
language: z.string(),
|
language: z.string(),
|
||||||
|
|||||||
@@ -107,10 +107,6 @@ export const userQueryRouter = router({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const apiJson = await apiResponse.json()
|
const apiJson = await apiResponse.json()
|
||||||
if (!apiJson.data?.length) {
|
|
||||||
throw notFound(apiJson)
|
|
||||||
}
|
|
||||||
|
|
||||||
const verifiedData = getStaysSchema.safeParse(apiJson)
|
const verifiedData = getStaysSchema.safeParse(apiJson)
|
||||||
if (!verifiedData.success) {
|
if (!verifiedData.success) {
|
||||||
throw internalServerError(verifiedData.error)
|
throw internalServerError(verifiedData.error)
|
||||||
|
|||||||
Reference in New Issue
Block a user