@xuda.io/drive_module 1.1.866 → 1.1.867

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 +8 -13
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1711,12 +1711,14 @@ exports.search_drive_files = async function (req) {
1711
1711
  mime_type,
1712
1712
  file_ext,
1713
1713
  type,
1714
- tags = [],
1714
+
1715
1715
  sort_by = "name",
1716
1716
  sort_dir = "desc",
1717
1717
  path = "/",
1718
1718
  } = req;
1719
1719
 
1720
+ let { tags = [] } = req;
1721
+
1720
1722
  let { limit = 100 } = req;
1721
1723
 
1722
1724
  const sort_by_obj = { name: "originalname", date: "date_created" };
@@ -1733,19 +1735,12 @@ exports.search_drive_files = async function (req) {
1733
1735
  var tagKey = val.split(":")[0];
1734
1736
  var tagVal = val.split(":")[1];
1735
1737
 
1736
- // if (!ret[tagKey]) ret[tagKey] = [];
1737
-
1738
- if (tagVal) {
1739
- if (tagKey === "tag") {
1740
- if (ret.$or.some((e) => e.tags))
1741
- ret.$or.push({ tags: { $in: tagVal } });
1742
- }
1738
+ if (tagKey === "tag") {
1739
+ tags.push(tagVal);
1740
+ }
1743
1741
 
1744
- if (tagKey === "tag") {
1745
- ret.$or.push({ [tagKey]: { $regex: tagVal } });
1746
- }
1747
- } else {
1748
- og_search += og_search;
1742
+ if (tagKey === "name") {
1743
+ ret.$or.push({ ["name"]: { $regex: tagVal } });
1749
1744
  }
1750
1745
 
1751
1746
  return ret;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.866",
3
+ "version": "1.1.867",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {