Restores the specified folders from the Media Manager's trash bin, and moves them to their original locations in the Media Manager.
The bulkRestoreFoldersFromTrashBin()
function returns a Promise that resolves when the folders have been restored.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function bulkRestoreFoldersFromTrashBin(
folderIds: Array<string>,
): Promise<void>;
IDs of the folders to restore from the Media Manager's trash bin.
import { folders } from "wix-media.v2";
/* Sample folderIds value:
* [
* 'd4051a6890724365a78678a6208ac37e',
* '302fc049d70c41dea33fa4a27ab481ba'
* ]
*/
async function myBulkRestoreFoldersFromTrashBinFunc(folderIds) {
try {
const restoredFolders =
await folders.bulkRestoreFoldersFromTrashBin(folderIds);
console.log("Restored deleted folders:", restoredFolders);
return restoredFolders;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise resolves to void */
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.