@xuda.io/drive_module 1.1.797 → 1.1.799

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 +10 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1090,24 +1090,22 @@ exports.create_drive_folder = async function (req, job_id, headers) {
1090
1090
  };
1091
1091
  }
1092
1092
  };
1093
- exports.rename_drive_file = async function (req) {
1093
+ exports.rename_drive_file = async function (req, job_id, headers) {
1094
1094
  try {
1095
1095
  const { drive_type, app_id, file_name_to, file_path } = req;
1096
1096
  validate_drive_type(drive_type);
1097
1097
 
1098
- let check_req = {
1099
- app_id,
1100
- uid,
1101
- drive_type,
1102
- file_path,
1103
- };
1104
- const check_existing_file_ret = await module.exports.check_drive_file(
1105
- check_req
1106
- );
1098
+ let doc = await get_drive_doc(drive_type, app_id, uid, file_path, headers);
1107
1099
 
1108
- // var target_file = file_name;
1100
+ if (drive_type === "studio") {
1101
+ await fs_module.rename(file_path, file_name_to);
1109
1102
 
1110
- let doc_ret;
1103
+ doc._delete = true;
1104
+ await db_module.save_app_couch_doc(app_id_master, doc_ret.data);
1105
+
1106
+ doc._id = file_name_to;
1107
+ delete doc._rev;
1108
+ }
1111
1109
 
1112
1110
  switch (drive_type) {
1113
1111
  case "studio": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.797",
3
+ "version": "1.1.799",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {