Skip to content

Commit b6d9596

Browse files
committed
#1250: Reverted changes to CheckList.tsx and ProposedSolutionsList.tsx
1 parent d2280d1 commit b6d9596

2 files changed

Lines changed: 10 additions & 27 deletions

File tree

src/frontend/src/components/CheckList.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { Tooltip } from '@mui/material';
1414
import { User } from 'shared';
1515
import NERModal from './NERModal';
1616
import { fullNamePipe } from '../utils/pipes';
17-
import { useToast } from '../hooks/toasts.hooks';
1817

1918
export type CheckListItem = {
2019
id: number;
@@ -35,21 +34,14 @@ const CheckList: React.FC<CheckListProps> = ({ title, items, isDisabled }) => {
3534
const { isLoading, mutateAsync } = useCheckDescriptionBullet();
3635
const [showConfirm, setShowConfirm] = useState<boolean>(false);
3736
const [currIdx, setCurrIdx] = useState<number>(-1);
38-
const toast = useToast();
3937

4038
const handleUncheck = async (idx: number) => {
4139
await handleCheck(idx);
4240
setShowConfirm(false);
4341
};
4442

4543
const handleCheck = async (idx: number) => {
46-
try {
47-
await mutateAsync({ userId: auth.user!.userId, descriptionId: items[idx].id });
48-
} catch (e) {
49-
if (e instanceof Error) {
50-
toast.error(e.message);
51-
}
52-
}
44+
await mutateAsync({ userId: auth.user!.userId, descriptionId: items[idx].id });
5345
};
5446

5547
items.sort((a: CheckListItem, b: CheckListItem) => {

src/frontend/src/pages/ChangeRequestDetailPage/ProposedSolutionsList.tsx

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import ErrorPage from '../ErrorPage';
1313
import LoadingIndicator from '../../components/LoadingIndicator';
1414
import { useAuth } from '../../hooks/auth.hooks';
1515
import { Button } from '@mui/material';
16-
import { useToast } from '../../hooks/toasts.hooks';
1716

1817
interface ProposedSolutionsListProps {
1918
proposedSolutions: ProposedSolution[];
@@ -25,7 +24,6 @@ const ProposedSolutionsList: React.FC<ProposedSolutionsListProps> = ({ proposedS
2524
const [showEditableForm, setShowEditableForm] = useState<boolean>(false);
2625
const auth = useAuth();
2726
const { isLoading, isError, error, mutateAsync } = useCreateProposeSolution();
28-
const toast = useToast();
2927

3028
if (isLoading || !auth.user) return <LoadingIndicator />;
3129
if (isError) return <ErrorPage message={error?.message} />;
@@ -35,22 +33,15 @@ const ProposedSolutionsList: React.FC<ProposedSolutionsListProps> = ({ proposedS
3533
const addProposedSolution = async (data: ProposedSolution) => {
3634
setShowEditableForm(false);
3735
const { description, timelineImpact, scopeImpact, budgetImpact } = data;
38-
39-
try {
40-
// send the details of new proposed solution to the backend database
41-
await mutateAsync({
42-
submitterId: userId,
43-
crId,
44-
description,
45-
scopeImpact,
46-
timelineImpact,
47-
budgetImpact
48-
});
49-
} catch (e) {
50-
if (e instanceof Error) {
51-
toast.error(e.message);
52-
}
53-
}
36+
// send the details of new proposed solution to the backend database
37+
await mutateAsync({
38+
submitterId: userId,
39+
crId,
40+
description,
41+
scopeImpact,
42+
timelineImpact,
43+
budgetImpact
44+
});
5445
};
5546

5647
return (

0 commit comments

Comments
 (0)