@xuda.io/drive_module 1.1.665 → 1.1.667
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.
- package/index.js +10 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1901,13 +1901,15 @@ exports.search_drive_files = async function (req) {
|
|
|
1901
1901
|
mime_type,
|
|
1902
1902
|
file_ext,
|
|
1903
1903
|
type,
|
|
1904
|
-
tags,
|
|
1904
|
+
tags = [],
|
|
1905
1905
|
} = req;
|
|
1906
1906
|
try {
|
|
1907
1907
|
validate_drive_type(drive_type);
|
|
1908
1908
|
|
|
1909
|
-
if (!search_name && !search_string && !tags?.length)
|
|
1910
|
-
|
|
1909
|
+
if (!search_name && !search_string && !tags?.length) {
|
|
1910
|
+
throw new Error("search to broad");
|
|
1911
|
+
}
|
|
1912
|
+
var search_results = [];
|
|
1911
1913
|
|
|
1912
1914
|
let selector = {
|
|
1913
1915
|
docType: `${drive_type}_drive`,
|
|
@@ -2049,7 +2051,11 @@ exports.search_drive_files = async function (req) {
|
|
|
2049
2051
|
data: search_results,
|
|
2050
2052
|
};
|
|
2051
2053
|
} catch (err) {
|
|
2052
|
-
return err.message;
|
|
2054
|
+
// return err.message;
|
|
2055
|
+
return {
|
|
2056
|
+
code: -200,
|
|
2057
|
+
data: err.message,
|
|
2058
|
+
};
|
|
2053
2059
|
}
|
|
2054
2060
|
};
|
|
2055
2061
|
|