@xuda.io/drive_module 1.1.614 → 1.1.616

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 +27 -21
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1418,11 +1418,17 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
1418
1418
  };
1419
1419
  doc = { ...doc, ...(await get_file_info(tempPath)) };
1420
1420
 
1421
- const { code: check_code, data: check_data } =
1422
- await module.exports.check_drive_file({
1423
- file_name: doc.originalname,
1424
- file_path: doc.file_path,
1425
- });
1421
+ const check_res = await module.exports.check_drive_file({
1422
+ app_id,
1423
+ uid,
1424
+ drive_type,
1425
+ file_name: doc.originalname,
1426
+ file_path: doc.file_path,
1427
+ });
1428
+
1429
+ // if (check_res.code < 0) {
1430
+ // return check_res;
1431
+ // }
1426
1432
 
1427
1433
  switch (drive_type) {
1428
1434
  case "studio": {
@@ -1475,22 +1481,22 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
1475
1481
  doc.app_id_reference = ref;
1476
1482
 
1477
1483
  /// check existing file
1478
- if (check_exist) {
1479
- const workspace_drive_res = await db_module.find_app_couch_query(
1480
- app_id,
1481
- {
1482
- selector: { docType: "workspace_drive", originalname, stat: 3 },
1483
- limit: 99,
1484
- }
1485
- );
1486
- if (workspace_drive_res.docs.length) {
1487
- return {
1488
- code: -762,
1489
- data: "file already exist",
1490
- duplicates: workspace_drive_res.docs,
1491
- };
1492
- }
1493
- }
1484
+ // if (check_exist) {
1485
+ // const workspace_drive_res = await db_module.find_app_couch_query(
1486
+ // app_id,
1487
+ // {
1488
+ // selector: { docType: "workspace_drive", originalname, stat: 3 },
1489
+ // limit: 99,
1490
+ // }
1491
+ // );
1492
+ // if (workspace_drive_res.docs.length) {
1493
+ // return {
1494
+ // code: -762,
1495
+ // data: "file already exist",
1496
+ // duplicates: workspace_drive_res.docs,
1497
+ // };
1498
+ // }
1499
+ // }
1494
1500
 
1495
1501
  doc.bucket = {
1496
1502
  [`${process.env.XUDA_HOSTNAME}`]: await upload_file_to_spaces(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.614",
3
+ "version": "1.1.616",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {