Skip to content

Commit

Permalink
Remove unnecessary null checks and change return type
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin-Chant committed May 10, 2024
1 parent 9d1b3c1 commit 15d048a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions packages/front-end/components/Ideas/ImpactModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Field from "@/components/Forms/Field";
import SelectField from "@/components/Forms/SelectField";

const ImpactModal: FC<{
idea?: IdeaInterface;
idea: IdeaInterface;
estimate?: ImpactEstimateInterface;
close: () => void;
mutate: () => void;
Expand All @@ -23,9 +23,9 @@ const ImpactModal: FC<{
defaultValues: {
metric: estimate?.metric || metrics[0]?.id || "",
segment: estimate?.segment || "",
userAdjustment: idea?.estimateParams?.userAdjustment || 100,
numVariations: idea?.estimateParams?.numVariations || 2,
improvement: idea?.estimateParams?.improvement || 10,
userAdjustment: idea.estimateParams.userAdjustment || 100,
numVariations: idea.estimateParams.numVariations || 2,
improvement: idea.estimateParams.improvement || 10,
},
});

Expand Down Expand Up @@ -58,7 +58,7 @@ const ImpactModal: FC<{
body: JSON.stringify({
metric: value.metric,
segment: value.segment || null,
ideaId: idea?.id || null,
ideaId: idea.id || null,
}),
}
);
Expand Down Expand Up @@ -97,7 +97,7 @@ const ImpactModal: FC<{
},
};

await apiCall(`/idea/${idea?.id}`, {
await apiCall(`/idea/${idea.id}`, {
method: "POST",
body: JSON.stringify(data),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function SingleRoleSelector({
sort={false}
formatOptionLabel={(value) => {
const r = roles.find((r) => r.id === value.label);
if (!r) return <></>;
if (!r) return value.label;
return (
<div className="d-flex align-items-center">
<strong style={{ width: 110 }}>{r.id}</strong>
Expand Down

0 comments on commit 15d048a

Please sign in to comment.