@xuda.io/drive_module 1.1.803 → 1.1.805
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 +24 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2777,10 +2777,27 @@ const get_drive_doc = async function (
|
|
|
2777
2777
|
return doc;
|
|
2778
2778
|
};
|
|
2779
2779
|
|
|
2780
|
-
const save_drive_doc = async function (
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
)
|
|
2780
|
+
const save_drive_doc = async function (drive_type, app_id, doc) {
|
|
2781
|
+
let save_ret;
|
|
2782
|
+
|
|
2783
|
+
switch (drive_type) {
|
|
2784
|
+
case "workspace":
|
|
2785
|
+
case "studio":
|
|
2786
|
+
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
2787
|
+
save_ret = await db_module.save_app_couch_doc(app_id_reference, doc);
|
|
2788
|
+
break;
|
|
2789
|
+
|
|
2790
|
+
case "user":
|
|
2791
|
+
save_ret = await db_module.save_couch_doc("xuda_drive", doc);
|
|
2792
|
+
break;
|
|
2793
|
+
|
|
2794
|
+
default:
|
|
2795
|
+
break;
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
if (save_ret.code < 0) {
|
|
2799
|
+
throw new Error(save_ret.data);
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
return save_ret;
|
|
2803
|
+
};
|