@xuda.io/drive_module 1.1.994 → 1.1.996
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 +8 -22
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -789,7 +789,7 @@ exports.get_drive_file_info = async function (req, job_id, headers) {
|
|
|
789
789
|
// }
|
|
790
790
|
// };
|
|
791
791
|
|
|
792
|
-
exports.delete_drive_files = async function (req) {
|
|
792
|
+
exports.delete_drive_files = async function (req, job_id, headers) {
|
|
793
793
|
try {
|
|
794
794
|
const { drive_type, app_id, files_arr, uid } = req;
|
|
795
795
|
validate_drive_type(drive_type);
|
|
@@ -814,30 +814,16 @@ exports.delete_drive_files = async function (req) {
|
|
|
814
814
|
|
|
815
815
|
switch (drive_type) {
|
|
816
816
|
case "studio": {
|
|
817
|
-
|
|
818
|
-
doc_ret = await db_module.get_app_couch_doc(
|
|
819
|
-
app_id_master,
|
|
820
|
-
path.basename(file.path)
|
|
821
|
-
);
|
|
817
|
+
debugger;
|
|
822
818
|
|
|
823
|
-
const ret = rimraf.sync(file.
|
|
824
|
-
if (doc_ret.code > -1) {
|
|
825
|
-
if (doc_ret.data.type === "directory") {
|
|
826
|
-
const docs = await get_folder_docs(
|
|
827
|
-
path.basename(file.path),
|
|
828
|
-
drive_type,
|
|
829
|
-
app_id_master
|
|
830
|
-
);
|
|
831
|
-
for await (let doc of docs) {
|
|
832
|
-
doc._deleted = true;
|
|
833
|
-
await db_module.save_app_couch_doc(app_id_master, doc);
|
|
834
|
-
}
|
|
835
|
-
}
|
|
819
|
+
const ret = rimraf.sync(file.file_path); // delete the file
|
|
836
820
|
|
|
837
|
-
|
|
821
|
+
if (doc.type === "file") {
|
|
822
|
+
doc.ts = Date.now();
|
|
823
|
+
doc.stat = 4;
|
|
838
824
|
save_ret = await db_module.save_app_couch_doc(
|
|
839
|
-
|
|
840
|
-
|
|
825
|
+
app_id_reference,
|
|
826
|
+
doc
|
|
841
827
|
);
|
|
842
828
|
}
|
|
843
829
|
|