Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
GDamaso committed Aug 14, 2024
1 parent c806d2c commit aa36aa6
Showing 1 changed file with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,32 @@ const FieldsAndSoilComponent: FC<InputModuleProps> = ({
}),
});

const removeField = (field: FieldDetailInterface) => {
const updatedFarmDetails = { ...farmDetails };

const idx = updatedFarmDetails.Fields.findIndex(
(f) => f.FieldName === field.FieldName && f.Area === field.Area,
);

updatedFarmDetails.Fields.splice(idx, 1);
setFarmDetails(updatedFarmDetails);
};

const editField = (field: FieldDetailInterface) => {
const idx = farmDetails.Fields.findIndex(
(f) => f.FieldName === field.FieldName && f.Area === field.Area,
);

setFieldIndex(idx);
setFieldAdd(true);
handleFormState(FIELDS_AND_SOIL, undefined, ACTIVE);
};

const addNewField = () => {
handleFormState(FIELDS_AND_SOIL, undefined, ACTIVE);
setFieldAdd(true);
};

/**
*
* @param values : It's of type FieldDetailInterface, it calls, FieldName, Area, and Comments
Expand Down Expand Up @@ -176,32 +202,6 @@ const FieldsAndSoilComponent: FC<InputModuleProps> = ({
}, 400);
};

const removeField = (field: FieldDetailInterface) => {
const updatedFarmDetails = { ...farmDetails };

const idx = updatedFarmDetails.Fields.findIndex(
(f) => f.FieldName === field.FieldName && f.Area === field.Area,
);

updatedFarmDetails.Fields.splice(idx, 1);
setFarmDetails(updatedFarmDetails);
};

const editField = (field: FieldDetailInterface) => {
const idx = farmDetails.Fields.findIndex(
(f) => f.FieldName === field.FieldName && f.Area === field.Area,
);

setFieldIndex(idx);
setFieldAdd(true);
handleFormState(FIELDS_AND_SOIL, undefined, ACTIVE);
};

const addNewField = () => {
handleFormState(FIELDS_AND_SOIL, undefined, ACTIVE);
setFieldAdd(true);
};

const SoilTextArray: string[] = [
'Different labs use different soil test methods for phosphorus (P) and potassium (K)',
'Different methods give different values for the same soil sample',
Expand Down

0 comments on commit aa36aa6

Please sign in to comment.