Refactor action handling in simulation components for improved clarity and efficiency
This commit is contained in:
@@ -330,15 +330,15 @@ function HumanMechanics() {
|
||||
setSelectedAction(newAction.actionUuid, newAction.actionName);
|
||||
};
|
||||
|
||||
const handleDeleteAction = () => {
|
||||
if (!selectedPointData || !selectedAction.actionId) return;
|
||||
const handleDeleteAction = (actionUuid: string) => {
|
||||
if (!selectedPointData || !actionUuid) return;
|
||||
|
||||
const updatedActions = selectedPointData.actions.filter(action => action.actionUuid !== selectedAction.actionId);
|
||||
const updatedActions = selectedPointData.actions.filter(action => action.actionUuid !== actionUuid);
|
||||
const updatedPoint = { ...selectedPointData, actions: updatedActions };
|
||||
|
||||
const event = removeAction(
|
||||
selectedProduct.productUuid,
|
||||
selectedAction.actionId
|
||||
actionUuid
|
||||
);
|
||||
|
||||
if (event) {
|
||||
|
||||
Reference in New Issue
Block a user