Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/custom/CatalogDetail/RightPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ const RightPanel: React.FC<RightPanelProps> = ({
handleVisibilityChange
}) => {
const cleanedType = type.replace('my-', '').replace(/s$/, '');
const { data: userProfile } = useGetUserProfileByIdQuery({
id: details.userId
});
// Skip the lookup when the card has no owner id — firing with an empty or
// undefined id reaches the server and surfaces a 400/404 that, upstream,
// leaks a plain-text body which RTK Query cannot parse as JSON.
Comment on lines +64 to +66
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The multi-line comment explaining the skip logic is verbose and adds unnecessary noise to the component logic. Consider moving this explanation to the PR description or a JSDoc block if documentation is required, or simplifying it to a single line.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collapsed to a single inline line — the why is preserved, the prose is gone.

const { data: userProfile } = useGetUserProfileByIdQuery(
{ id: details.userId },
{ skip: !details.userId }
);

return (
<div>
Expand Down
Loading