@@ -28,6 +28,7 @@ import CreateStudyDialog from '../dialogs/create-study-dialog/create-study-dialo
28
28
import { DialogsId } from '../../utils/UIconstants' ;
29
29
30
30
import {
31
+ deleteElements ,
31
32
duplicateCase ,
32
33
duplicateContingencyList ,
33
34
duplicateFilter ,
@@ -42,7 +43,6 @@ import {
42
43
renameElement ,
43
44
replaceFiltersWithScript ,
44
45
replaceFormContingencyListWithScript ,
45
- stashElements ,
46
46
} from '../../utils/rest-api' ;
47
47
48
48
import { ContingencyListType , FilterType } from '../../utils/elementType' ;
@@ -292,16 +292,16 @@ const ContentContextualMenu = (props) => {
292
292
} , [ onClose , setOpenDialog ] ) ;
293
293
294
294
const [ deleteError , setDeleteError ] = useState ( '' ) ;
295
- const handleStashElements = useCallback (
295
+ const handleDeleteElements = useCallback (
296
296
( elementsUuids ) => {
297
- stashElements ( elementsUuids )
297
+ deleteElements ( elementsUuids , selectedDirectory . elementUuid )
298
298
. catch ( ( error ) => {
299
299
setDeleteError ( error . message ) ;
300
300
handleLastError ( error . message ) ;
301
301
} )
302
302
. finally ( ( ) => handleCloseDialog ( ) ) ;
303
303
} ,
304
- [ handleCloseDialog , handleLastError ]
304
+ [ selectedDirectory ?. elementUuid , handleCloseDialog , handleLastError ]
305
305
) ;
306
306
307
307
const moveElementErrorToString = useCallback (
@@ -660,7 +660,7 @@ const ContentContextualMenu = (props) => {
660
660
open = { true }
661
661
onClose = { handleCloseDialog }
662
662
onClick = { ( ) =>
663
- handleStashElements (
663
+ handleDeleteElements (
664
664
selectedElements . map ( ( e ) => e . elementUuid )
665
665
)
666
666
}
0 commit comments