Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored May 6, 2024
1 parent 42f73ad commit 3f0e1d0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import { notifications } from '@mantine/notifications';
import { APIClient } from '@api/api_client';
import { Service } from '@/app/services/types';
import { use, useMemo, useState } from 'react';
import { ExportsCard, downloadFile, generateErrorFromResponse, type DownloadFileHeaders } from '../ExportsCard/ExportsCard';
import {
ExportsCard,
downloadFile,
generateErrorFromResponse,
type DownloadFileHeaders,
} from '../ExportsCard/ExportsCard';

type AttendanceExportsProps = {
names: string[];
Expand Down
22 changes: 11 additions & 11 deletions interapp-frontend/src/app/exports/ExportsCard/ExportsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,37 @@ export const generateErrorFromResponse = (response: AxiosResponse) => {
case 200:
break;
case 400:
return ({
return {
title: 'Error',
message: parseServerError(response.data),
color: 'red',
});
};
case 401:
return ({
return {
title: 'Error',
message: 'Unauthorized',
color: 'red',
});
};
case 403:
return ({
return {
title: 'Error',
message: 'Forbidden',
color: 'red',
});
};
case 404:
return ({
return {
title: 'Error',
message: 'Sessions between the selected dates are not found',
color: 'red',
});
};
default:
return ({
return {
title: 'Error',
message: 'Unknown error',
color: 'red',
});
};
}
}
};

interface ExportsCardProps {
children: ReactNode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
'use client';
import { ExportsCard, downloadFile, generateErrorFromResponse, type DownloadFileHeaders } from '../ExportsCard/ExportsCard';
import {
ExportsCard,
downloadFile,
generateErrorFromResponse,
type DownloadFileHeaders,
} from '../ExportsCard/ExportsCard';
import { Select, Button, Group } from '@mantine/core';
import { APIClient } from '@api/api_client';
import { useForm } from '@mantine/form';
Expand Down

0 comments on commit 3f0e1d0

Please sign in to comment.