@xuda.io/drive_module 1.1.995 → 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.
Files changed (2) hide show
  1. package/index.js +7 -21
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -814,30 +814,16 @@ exports.delete_drive_files = async function (req, job_id, headers) {
814
814
 
815
815
  switch (drive_type) {
816
816
  case "studio": {
817
- const app_id_master = await _common.get_project_app_id(app_id);
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.path); // delete the 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
- doc_ret.data._deleted = true;
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
- app_id_master,
840
- doc_ret.data
825
+ app_id_reference,
826
+ doc
841
827
  );
842
828
  }
843
829
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.995",
3
+ "version": "1.1.996",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {