update query wait to use error message if one is available
This commit is contained in:
@ -22,9 +22,8 @@ const EditResourcePage = () => {
|
||||
{ id },
|
||||
{
|
||||
enabled: router.isReady,
|
||||
onError(err) {
|
||||
console.log(err);
|
||||
throw err;
|
||||
retry(_failureCount, error) {
|
||||
return error.data?.httpStatus !== 404;
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -82,7 +82,14 @@ const ResourceViewPage = () => {
|
||||
const router = useRouter();
|
||||
const id = router.query["id"]?.toString() ?? "";
|
||||
|
||||
const resourceQuery = api.auditoryResource.byId.useQuery({ id });
|
||||
const resourceQuery = api.auditoryResource.byId.useQuery(
|
||||
{ id },
|
||||
{
|
||||
retry(_failureCount, error) {
|
||||
return error.data?.httpStatus !== 404;
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const ConditionalView = (data: AuditoryResource) => {
|
||||
return (
|
||||
|
Reference in New Issue
Block a user