Skip to content

Commit

Permalink
style: Some nits on the code
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisChV committed Dec 4, 2024
1 parent d92ea86 commit bb90f0b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/generic/toast-context/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export interface WraperProps {
children: React.ReactNode;
}

// eslint-disable-next-line react/prop-types
const TestComponentToShow = () => {
const { showToast } = React.useContext(ToastContext);

Expand Down
2 changes: 1 addition & 1 deletion src/library-authoring/library-team/LibraryTeam.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ describe('<LibraryTeam />', () => {
it('shows error', async () => {
const url = getLibraryTeamApiUrl(libraryId);
const axiosMock = new MockAdapter(getAuthenticatedHttpClient());
axiosMock.onPost(url).reply(400, { error: 'Error' });
axiosMock.onPost(url).reply(400, {});

await renderLibraryTeam();

Expand Down
4 changes: 2 additions & 2 deletions src/library-authoring/library-team/LibraryTeam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ const LibraryTeam: React.FC<Record<never, never>> = () => {
}).then(() => {
showToast(intl.formatMessage(messages.addMemberSuccess));
}).catch((addMemberError) => {
const errorData = addMemberError.response.data;
if ('email' in errorData) {
const errorData = typeof addMemberError === 'object' ? addMemberError.response?.data : undefined;
if (errorData && 'email' in errorData) {
showToast(intl.formatMessage(messages.addMemberEmailError));
} else {
showToast(intl.formatMessage(messages.addMemberError));
Expand Down

0 comments on commit bb90f0b

Please sign in to comment.