Search...
moveFoldersToTrash( )
Moves single or multiple folders, including their files and sub-folders, to the Media Manager's trash.
Description
The moveFoldersToTrash()
function returns a Promise that resolves when the folder(s)
are moved to the Media Manager's trash.
Moving many folders to trash at once is an asynchronous action. It may take some time for the results to be seen in the Media Manager.
Use the Media Manager to restore or permanently delete trashed folders.
Attempting to move already-trashed folders to trash again doesn't result in an error.
Syntax
function moveFoldersToTrash(folderIds: Array<string>): Promise<void>
moveFoldersToTrash Parameters
NAME
TYPE
DESCRIPTION
folderIds
Array<string>
IDs of the folders to move to trash.
Returns
Return Type:
Promise<void>
Was this helpful?
Move a single folder to trash
Copy Code
1import { mediaManager } from 'wix-media-backend';23/* Sample folderIds array:4 * [5 * 'de4e7c3258f444e9a506a8572d951ddf',6 * 'a2597566072c463492f9963c377f3f74'7 * ]8 */910export function myMoveFoldersToTrashFunction(folderIds) {11 return mediaManager.moveFoldersToTrash(folderIds)12 .then(() => {13 console.log('Success! Folders have been trashed.');14 })15 .catch((error) => {16 console.error(error);17 })18}1920/**21 * Returns a promise that resolves to <void>22 **/