Move files and folders to trash
The secrecyClient.cloud.deleteNode method moves a file or folder to the trash (soft delete) in the cloud. It takes a single parameter, nodeId, which represents the ID of the file or folder to be deleted
cloud.ts
const moveFileOrFolderToTrash = async (nodeId: string): Promise<boolean> => {
// First we need to check if the secrecyClient is available
if (!secrecyClient) {
return false;
}
try {
const isDeleted = await secrecyClient.cloud.deleteNode({
nodeId,
});
return isDeleted;
} catch (error) {
console.error(error);
return false;
}
};Moving a node to the trash is reversible: see restore from trash to bring it back, and delete definitively files and folders to remove it for good.