@xuda.io/drive_module 1.1.1154 → 1.1.1156
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 +11 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -64,6 +64,11 @@ exports.get_drive_files = async function (req) {
|
|
|
64
64
|
const { from = 0, to = 99999, drive_type, app_id, uid, type, date, search_string, sort_by = 'name', sort_dir = 'desc' } = req;
|
|
65
65
|
|
|
66
66
|
let { tags = [] } = req;
|
|
67
|
+
|
|
68
|
+
if (!['asc', 'desc'].includes(sort_dir)) {
|
|
69
|
+
throw 'invalid value for sort_dir (asc/desc)';
|
|
70
|
+
}
|
|
71
|
+
|
|
67
72
|
let tags_query = {};
|
|
68
73
|
const sort_by_obj = {
|
|
69
74
|
name: type === 'file' ? 'originalname' : 'folder_name',
|
|
@@ -398,7 +403,12 @@ exports.get_drive_files = async function (req) {
|
|
|
398
403
|
throw new Error('drive_type error');
|
|
399
404
|
}
|
|
400
405
|
} catch (err) {
|
|
401
|
-
return err.message;
|
|
406
|
+
// return err.message;
|
|
407
|
+
|
|
408
|
+
return {
|
|
409
|
+
code: -1,
|
|
410
|
+
data: err.message,
|
|
411
|
+
};
|
|
402
412
|
}
|
|
403
413
|
};
|
|
404
414
|
|