@xuda.io/drive_module 1.1.758 → 1.1.760
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 +7 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -633,11 +633,13 @@ exports.delete_drive_files = async function (req) {
|
|
|
633
633
|
|
|
634
634
|
exports.update_drive_file = async function (req, job_id, headers, file_obj) {
|
|
635
635
|
try {
|
|
636
|
-
const { drive_type, app_id, file_path,
|
|
636
|
+
const { drive_type, app_id, file_path, uid } = req;
|
|
637
637
|
validate_drive_type(drive_type);
|
|
638
638
|
|
|
639
639
|
const originalname = file_obj?.["originalname"];
|
|
640
640
|
|
|
641
|
+
const file_name = path.basename(file_path);
|
|
642
|
+
|
|
641
643
|
if (!originalname) {
|
|
642
644
|
return { code: -4, data: "file data missing" };
|
|
643
645
|
}
|
|
@@ -781,12 +783,6 @@ exports.update_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
781
783
|
return {
|
|
782
784
|
code: -760,
|
|
783
785
|
data: "file not found",
|
|
784
|
-
// data: {
|
|
785
|
-
// server_file_name: `https://${process.env.XUDA_HOSTNAME}/${
|
|
786
|
-
// req.drive_type === "studio" ? "uploads" : "drive"
|
|
787
|
-
// }${req.file_name}`,
|
|
788
|
-
// filename: file_obj.originalname,
|
|
789
|
-
// },
|
|
790
786
|
};
|
|
791
787
|
}
|
|
792
788
|
} catch (err) {
|
|
@@ -2377,21 +2373,22 @@ const get_folder_docs = async function (dir, drive_type, app_id) {
|
|
|
2377
2373
|
|
|
2378
2374
|
exports.update_drive_file_tags = async function (req, job_id, headers) {
|
|
2379
2375
|
try {
|
|
2380
|
-
const { drive_type, app_id, uid, file_path,
|
|
2376
|
+
const { drive_type, app_id, uid, file_path, tags = [] } = req;
|
|
2377
|
+
const file_name = path.basename(file_path);
|
|
2381
2378
|
validate_drive_type(drive_type);
|
|
2382
2379
|
|
|
2383
2380
|
let check_req = {
|
|
2384
2381
|
app_id,
|
|
2385
2382
|
uid,
|
|
2386
2383
|
drive_type,
|
|
2387
|
-
|
|
2384
|
+
|
|
2388
2385
|
file_path,
|
|
2389
2386
|
};
|
|
2390
2387
|
const check_existing_file_ret = await module.exports.check_drive_file(
|
|
2391
2388
|
check_req
|
|
2392
2389
|
);
|
|
2393
2390
|
|
|
2394
|
-
var target_file =
|
|
2391
|
+
var target_file = file_name;
|
|
2395
2392
|
// const master_id = await _common.get_project_app_id(app_id, true);
|
|
2396
2393
|
|
|
2397
2394
|
let doc_ret;
|