@xuda.io/drive_module 1.1.631 → 1.1.633

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 +12 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1604,12 +1604,11 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
1604
1604
  const { drive_type, app_id, uid, file_name, file_path } = req;
1605
1605
  var master_app_id;
1606
1606
 
1607
- switch (drive_type) {
1608
- case "studio":
1609
- case "workspace": {
1610
- master_app_id = await _common.get_project_app_id(app_id, true);
1611
- }
1607
+ if (["studio", "workspace"].includes(drive_type)) {
1608
+ master_app_id = await _common.get_project_app_id(app_id, true);
1609
+ }
1612
1610
 
1611
+ switch (drive_type) {
1613
1612
  case "studio": {
1614
1613
  const target_dir = path.join(_conf[`studio_drive_path`], master_app_id);
1615
1614
  // file_name = path.join(file_path.replace(target_dir, ""), originalname);
@@ -1633,7 +1632,7 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
1633
1632
  {
1634
1633
  selector: {
1635
1634
  docType: "workspace_drive",
1636
- file_name,
1635
+ originalname: file_name,
1637
1636
  file_path,
1638
1637
  stat: 3,
1639
1638
  },
@@ -1652,7 +1651,13 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
1652
1651
  }
1653
1652
  case "user": {
1654
1653
  const user_drive_res = await db_module.find_couch_query("xuda_drive", {
1655
- selector: { docType: "user_drive", file_name, file_path, uid, stat: 3 },
1654
+ selector: {
1655
+ docType: "user_drive",
1656
+ originalname: file_name,
1657
+ file_path,
1658
+ uid,
1659
+ stat: 3,
1660
+ },
1656
1661
  limit: 99,
1657
1662
  });
1658
1663
  if (user_drive_res.docs.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.631",
3
+ "version": "1.1.633",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {