@ape.swap/bonds-sdk 2.6.1-3.testshare.4 → 2.6.1-3.testshare.5
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/dist/main.js +13 -8
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -72097,14 +72097,19 @@ function generateImageFromTemplate(bondNFTData, link, apiUrl) {
|
|
|
72097
72097
|
share(link);
|
|
72098
72098
|
}
|
|
72099
72099
|
else {
|
|
72100
|
-
|
|
72101
|
-
|
|
72102
|
-
|
|
72103
|
-
|
|
72104
|
-
|
|
72105
|
-
|
|
72106
|
-
|
|
72107
|
-
|
|
72100
|
+
try {
|
|
72101
|
+
const dataImage = yield domtoimage.toJpeg(templateElement, { quality: 0.85 });
|
|
72102
|
+
const response = yield fetch(dataImage);
|
|
72103
|
+
const blob = yield response.blob();
|
|
72104
|
+
let formData = new FormData();
|
|
72105
|
+
formData.append('file', blob, fileName);
|
|
72106
|
+
yield axios.post(`${apiUrl}/cloudinary/uploadFile`, formData, {
|
|
72107
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
72108
|
+
});
|
|
72109
|
+
}
|
|
72110
|
+
catch (error) {
|
|
72111
|
+
console.error('Error upload file to cloudinary', error);
|
|
72112
|
+
}
|
|
72108
72113
|
share(link);
|
|
72109
72114
|
}
|
|
72110
72115
|
}
|