Skip to content

Commit

Permalink
refactor: remove any and add guard clause to ensure expected type
Browse files Browse the repository at this point in the history
- As per: https://github.com/theopensystemslab/planx-new/pull/2701/files#r1474340729
- Removed `any`
- To avoid type issues check that a feedbackOption has been set
  • Loading branch information
Mike-Heneghan committed Feb 1, 2024
1 parent 5c8a4c3 commit d04f132
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor.planx.uk/src/components/Feedback/MoreInfoFeedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ const MoreInfoFeedbackComponent: React.FC = () => {
};

async function handleFeedbackFormSubmit(values: UserFeedback) {
const metadata: any = await getInternalFeedbackMetadata();
if (!feedbackOption) return;
const metadata = await getInternalFeedbackMetadata();
const feedbackType = { feedbackType: feedbackOption };
const data = { ...metadata, ...feedbackType, ...values };
await insertFeedbackMutation(data);
Expand Down

0 comments on commit d04f132

Please sign in to comment.