zet-lib 1.4.27 → 1.4.28
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/lib/zRoute.js +8 -12
- package/package.json +1 -1
package/lib/zRoute.js
CHANGED
|
@@ -4898,17 +4898,7 @@ zRoute.updateSQL = async (req, res, table, data, whereData) => {
|
|
|
4898
4898
|
//console.log('has dropbox')
|
|
4899
4899
|
let dir1 = `/${MYMODEL.table}/${key}`;
|
|
4900
4900
|
let dir2 = `/temps/${MYMODEL.table}/${key}/${userId}`;
|
|
4901
|
-
|
|
4902
|
-
await dbx.filesCreateFolderV2({
|
|
4903
|
-
path: dir1,
|
|
4904
|
-
autorename: false,
|
|
4905
|
-
});
|
|
4906
|
-
} catch (error) {
|
|
4907
|
-
if (error.status !== 409) {
|
|
4908
|
-
// 409 means folder already exists
|
|
4909
|
-
//throw error;
|
|
4910
|
-
}
|
|
4911
|
-
}
|
|
4901
|
+
await zDropbox.ensureFolder(dir1);
|
|
4912
4902
|
let name = `dropbox__${userId}__${MYMODEL.table}__${key}__${whereData.id}`;
|
|
4913
4903
|
if (myCache.has(name)) {
|
|
4914
4904
|
let arr = myCache.get(name) || [];
|
|
@@ -4936,11 +4926,17 @@ zRoute.updateSQL = async (req, res, table, data, whereData) => {
|
|
|
4936
4926
|
const finalPath = metadata.result.path_display;
|
|
4937
4927
|
if (finalPath) {
|
|
4938
4928
|
let newItem = Util.cleanString(time + item);
|
|
4939
|
-
newArr.push(newItem);
|
|
4940
4929
|
movDropboxArr.push({
|
|
4941
4930
|
from_path: `${dir2}/${item}`,
|
|
4931
|
+
from_dir: dir2,
|
|
4942
4932
|
to_path: `${dir1}/${newItem}`,
|
|
4933
|
+
to_dir: dir1,
|
|
4943
4934
|
});
|
|
4935
|
+
newArr.push(newItem);
|
|
4936
|
+
/*movDropboxArr.push({
|
|
4937
|
+
from_path: `${dir2}/${item}`,
|
|
4938
|
+
to_path: `${dir1}/${newItem}`,
|
|
4939
|
+
});*/
|
|
4944
4940
|
}
|
|
4945
4941
|
} catch (e) {
|
|
4946
4942
|
console.log(e);
|