@xuda.io/drive_module 1.1.475 → 1.1.477
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.js +18 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -524,7 +524,6 @@ exports.delete_drive_files = async function (req) {
|
|
|
524
524
|
app_id_reference
|
|
525
525
|
);
|
|
526
526
|
for await (let doc of docs) {
|
|
527
|
-
console.log(doc);
|
|
528
527
|
if (doc.type === "file") {
|
|
529
528
|
await module.exports.delete_file_from_bucket(doc.bucket);
|
|
530
529
|
}
|
|
@@ -546,7 +545,24 @@ exports.delete_drive_files = async function (req) {
|
|
|
546
545
|
|
|
547
546
|
case "user": {
|
|
548
547
|
doc_ret = await db_module.get_couch_doc("xuda_drive", file.name);
|
|
549
|
-
|
|
548
|
+
if (doc_ret.data.type === "file") {
|
|
549
|
+
await module.exports.delete_file_from_bucket(doc_ret.data.bucket);
|
|
550
|
+
}
|
|
551
|
+
if (doc_ret.data.type === "directory") {
|
|
552
|
+
const docs = await get_folder_docs(
|
|
553
|
+
path.basename(file.path),
|
|
554
|
+
drive_type,
|
|
555
|
+
null
|
|
556
|
+
);
|
|
557
|
+
for await (let doc of docs) {
|
|
558
|
+
if (doc.type === "file") {
|
|
559
|
+
await module.exports.delete_file_from_bucket(doc.bucket);
|
|
560
|
+
}
|
|
561
|
+
doc.ts = Date.now();
|
|
562
|
+
doc.stat = 4;
|
|
563
|
+
await db_module.save_couch_doc("xuda_drive", doc);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
550
566
|
doc_ret.data.ts = Date.now();
|
|
551
567
|
doc_ret.data.stat = 4;
|
|
552
568
|
save_ret = await db_module.save_couch_doc("xuda_drive", doc_ret.data);
|