@xuda.io/drive_module 1.1.888 → 1.1.890

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 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -91,8 +91,6 @@ exports.get_drive_files = async function (req) {
91
91
  uid,
92
92
  type,
93
93
  date,
94
- mime_type,
95
- file_ext,
96
94
  search_string,
97
95
  sort_by = "name",
98
96
  sort_dir = "desc",
@@ -110,6 +108,7 @@ exports.get_drive_files = async function (req) {
110
108
  },
111
109
  limit: to - from,
112
110
  skip: from,
111
+ sort: [{ [sort_by_obj[sort_by]]: sort_dir }],
113
112
  };
114
113
 
115
114
  if (req.path) {
@@ -132,6 +131,12 @@ exports.get_drive_files = async function (req) {
132
131
  if (tagKey === "name") {
133
132
  ret.$or.push({ originalname: { $regex: `(?i)${tagVal}` } });
134
133
  }
134
+ if (tagKey === "mime") {
135
+ ret.$or.push({ mime: { $regex: `(?i)${tagVal}` } });
136
+ }
137
+ if (tagKey === "ext") {
138
+ ret.$or.push({ file_ext: { $regex: `(?i)${tagVal}` } });
139
+ }
135
140
 
136
141
  return ret;
137
142
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.888",
3
+ "version": "1.1.890",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {