fix: missing previous data throwing error
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}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -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