Remove an item completely by recursively removing its child items

Share:

Description

BEWARE: This completely removes ALL CHILD ITEMS AND THEIR CHILDREN as well as the item itself.

Usage

1

Arguments

...

Additional parameters are passed on to GET, POST, HEAD, PUT, or DELETE

session

Session object from authenticate_sb. Defaults to anonymous or last authenticated session

sb_id

An sbitem object or a character ScienceBase ID corresponding to the item

Value

TRUE to indicate success

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# Create an item with nested structure
authenticate_sb()
fname <- "chairs"
folder = folder_create(user_id(), name = fname)
item_create(folder, title='child1')
item_create(folder, title='child2')

item_list_children(folder)

# then delete the whole folder
sbtools:::item_rm_recursive(folder)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.