@xuda.io/drive_module 1.1.1434 → 1.1.1436
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +2 -11
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -624,21 +624,12 @@ export const delete_drive_files = async (req, job_id, headers) => {
|
|
|
624
624
|
ret = await db_module.sava_app_couch_bulk_docs(app_id_delete, docs);
|
|
625
625
|
|
|
626
626
|
// cleanup
|
|
627
|
-
for await (const
|
|
628
|
-
let doc = await get_drive_doc(file.type, drive_type, app_id, uid, file.file_path, headers);
|
|
629
|
-
|
|
630
|
-
if (doc.type === 'directory') {
|
|
631
|
-
const files_in_directory = await get_folder_files(uid, app_id, drive_type, path.join(doc.file_path, doc.folder_name));
|
|
632
|
-
if (files_in_directory?.length) {
|
|
633
|
-
throw new Error(`Directory is not empty`);
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
|
|
627
|
+
for await (const doc of docs) {
|
|
637
628
|
let save_ret;
|
|
638
629
|
switch (drive_type) {
|
|
639
630
|
case 'studio': {
|
|
640
631
|
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
641
|
-
const target_dir = path.join(_conf[`studio_drive_path`], app_id_reference,
|
|
632
|
+
const target_dir = path.join(_conf[`studio_drive_path`], app_id_reference, originalname);
|
|
642
633
|
|
|
643
634
|
rimraf.sync(target_dir);
|
|
644
635
|
|