Skip to content

Commit

Permalink
add console to trace error
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoni authored and demenech committed Dec 21, 2023
1 parent 4fe37aa commit 796f685
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pages/[org]/[dataset]/r/[resource]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,20 @@ const Resource: React.FC<{ variables: any }> = ({ variables }) => {
return (
<ErrorMessage error={error} message="Error loading data"></ErrorMessage>
);
if (!data?.dataset) return <FourOhFour></FourOhFour>;
if (!data?.dataset) {
console.log('======= FROTEND DATASET NOT AVAILABLE ==========');
return <FourOhFour></FourOhFour>;
}
const { result } = data.dataset;
// Find right resource
const resource = result.resources.find(
(item) => item.name === variables.resource
);

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

fixTranslations(result);
fixTranslations(result.organization);
Expand Down

0 comments on commit 796f685

Please sign in to comment.