Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
meetulr committed Oct 26, 2024
1 parent 689ad90 commit abaf86e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/AddPeopleToTag/AddPeopleToTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { toast } from 'react-toastify';
import { ADD_PEOPLE_TO_TAG } from 'GraphQl/Mutations/TagMutations';
import InfiniteScroll from 'react-infinite-scroll-component';
import { WarningAmberRounded } from '@mui/icons-material';
import { useTranslation } from 'react-i18next';

/**
* Props for the `AddPeopleToTag` component.
Expand Down Expand Up @@ -43,6 +44,8 @@ const AddPeopleToTag: React.FC<InterfaceAddPeopleToTagProps> = ({
}) => {
const { tagId: currentTagId } = useParams();

const { t: tErrors } = useTranslation('error');

const [assignToMembers, setAssignToMembers] = useState<InterfaceMemberData[]>(
[],
);
Expand Down Expand Up @@ -164,9 +167,9 @@ const AddPeopleToTag: React.FC<InterfaceAddPeopleToTagProps> = ({
}
} catch (error: unknown) {
/* istanbul ignore next */
if (error instanceof Error) {
toast.error(error.message);
}
const errorMessage =
error instanceof Error ? error.message : tErrors('unknownError');
toast.error(errorMessage);

Check warning on line 172 in src/components/AddPeopleToTag/AddPeopleToTag.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/AddPeopleToTag/AddPeopleToTag.tsx#L172

Added line #L172 was not covered by tests
}
};

Expand Down

0 comments on commit abaf86e

Please sign in to comment.