Skip to content

Commit

Permalink
made function specific to secinrate and updated customrate value
Browse files Browse the repository at this point in the history
  • Loading branch information
gyordong committed Nov 22, 2024
1 parent 5359c6e commit 8f223a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function CreateUnitModalComponent() {
setShowCustomInput(true);
} else {
setRate(value);
setState({ ...state, [e.target.name]: Number(value) });
setState({ ...state, secInRate: Number(value) });
setShowCustomInput(false);
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/client/app/components/unit/EditUnitModalComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function EditUnitModalComponent(props: EditUnitModalComponentProp
const translate = useTranslate();
const [submitEditedUnit] = unitsApi.useEditUnitMutation();
const [deleteUnit] = unitsApi.useDeleteUnitMutation();
const CUSTOM_INPUT = '-99';
const CUSTOM_INPUT = '-77';

// Set existing unit values
const values = { ...props.unit };
Expand Down Expand Up @@ -200,7 +200,7 @@ export default function EditUnitModalComponent(props: EditUnitModalComponentProp
useEffect(() => {
// This checks:
// - Name cannot be blank
// - If type of unit is suffix their must be a suffix
// - If type of unit is suffix there must be a suffix
// - The rate is set so not the custom input value. This happens if select custom value but don't input with enter.
// - The custom rate is a positive integer
const validUnit = state.name !== '' &&
Expand Down

0 comments on commit 8f223a1

Please sign in to comment.