Skip to content

Commit

Permalink
Update index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoni authored and demenech committed Dec 21, 2023
1 parent 796f685 commit 019a9cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pages/[org]/[dataset]/r/[resource]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ErrorMessage } from '../../../../../components/_shared';
import FourOhFour from '../../../../404';

const Resource: React.FC<{ variables: any }> = ({ variables }) => {
console.log('======= FRONTEND ERROR LOG ==========');
const { t } = useTranslation('common');
const { data, loading, error } = useQuery(GET_DATASET_QUERY, {
variables,
Expand All @@ -28,6 +29,7 @@ const Resource: React.FC<{ variables: any }> = ({ variables }) => {
return (
<ErrorMessage error={error} message="Error loading data"></ErrorMessage>
);
console.log('======= FRONTEND ERROR DATASET ==========');
if (!data?.dataset) {
console.log('======= FROTEND DATASET NOT AVAILABLE ==========');
return <FourOhFour></FourOhFour>;
Expand All @@ -37,7 +39,7 @@ const Resource: React.FC<{ variables: any }> = ({ variables }) => {
const resource = result.resources.find(
(item) => item.name === variables.resource
);

console.log('======= FRONTEND ERROR RESOURCE ==========');
if (!resource) {
console.log('======= FROTEND RESOURCE NOT AVAILABLE ==========');
return <FourOhFour></FourOhFour>;
Expand Down

0 comments on commit 019a9cb

Please sign in to comment.