Skip to content

Commit

Permalink
removing some comments and the error condition
Browse files Browse the repository at this point in the history
  • Loading branch information
thinknoack committed Dec 3, 2024
1 parent 3db5617 commit 2b17cb3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 0 additions & 2 deletions packages/openneuro-app/src/scripts/users/user-query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const dummyUsers: Record<string, any> = {
},
};

// Default user data for invalid or unknown users
const getDefaultUser = (orcid: string) => ({
id: 'unknown',
name: 'Unknown User',
Expand All @@ -40,7 +39,6 @@ const getDefaultUser = (orcid: string) => ({
orcid,
});

// Function to get the user based on ORCID
const getUserByOrcid = (orcid: string) => dummyUsers[orcid] || getDefaultUser(orcid);

// Helper function to validate ORCID format
Expand Down
7 changes: 1 addition & 6 deletions packages/openneuro-app/src/scripts/users/user-routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@ import FourOThreePage from "../errors/403page";
// Define types for the props
interface UserRoutesProps {
user: any;

Check failure on line 12 in packages/openneuro-app/src/scripts/users/user-routes.tsx

View workflow job for this annotation

GitHub Actions / eslint

Unexpected any. Specify a different type
error?: Error; // Optional error prop
hasEdit: boolean;
}

export const UserRoutes: React.FC<UserRoutesProps> = ({ user, error, hasEdit }) => {
if (error) {
throw error; // Optionally, handle error more gracefully based on your use case
}

export const UserRoutes: React.FC<UserRoutesProps> = ({ user, hasEdit }) => {
return (
<Routes>
<Route path="/*" element={<FourOFourPage />} />
Expand Down

0 comments on commit 2b17cb3

Please sign in to comment.