Skip to content

Commit ecd91df

Browse files
#1487: fixed small syntax issues and threw appropriate errors
1 parent 922effb commit ecd91df

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/frontend/src/hooks/change-requests.hooks.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ export interface CreateProposeSolutionPayload {
135135
scopeImpact: string;
136136
timelineImpact: number;
137137
budgetImpact: number;
138-
type: string;
139138
}
140139

141140
/**
@@ -208,7 +207,7 @@ export const useRequestCRReview = (crId: string) => {
208207
const queryClient = useQueryClient();
209208
return useMutation<{ message: string }, Error, CRReviewPayload>(
210209
['change requests', 'review'],
211-
async (crReviewPayload) => {
210+
async (crReviewPayload: CRReviewPayload) => {
212211
const { data } = await requestCRReview(crId, crReviewPayload);
213212
return data;
214213
},

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ const ProposedSolutionsList: React.FC<ProposedSolutionsListProps> = ({ proposedS
4747
description,
4848
scopeImpact,
4949
timelineImpact,
50-
budgetImpact,
51-
type: ''
50+
budgetImpact
5251
});
5352
} catch (e) {
5453
if (e instanceof Error) {

src/frontend/src/pages/WorkPackageDetailPage/ActivateWorkPackageModalContainer/ActivateWorkPackageModalContainer.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,19 @@ const ActivateWorkPackageModalContainer: React.FC<ActivateWorkPackageModalContai
4141
const handleConfirm = async ({ projectLeadId, projectManagerId, startDate, confirmDetails }: FormInput) => {
4242
handleClose();
4343
if (auth.user?.userId === undefined) throw new Error('Cannot create activation change request without being logged in');
44+
if (projectLeadId === undefined) {
45+
throw new Error('Project Lead Id must be defined to create an activation change request');
46+
}
47+
if (projectManagerId === undefined) {
48+
throw new Error('Project Manager Id must be defined to create an activation change request');
49+
}
4450
try {
4551
await mutateAsync({
4652
submitterId: auth.user?.userId,
4753
wbsNum,
4854
type: ChangeRequestType.Activation,
49-
projectLeadId: projectLeadId || 0,
50-
projectManagerId: projectManagerId || 0,
55+
projectLeadId,
56+
projectManagerId,
5157
startDate: startDate.toISOString(),
5258
confirmDetails
5359
});

0 commit comments

Comments
 (0)