BNLZWPJDKWXBK5KQXKQALAL4WOLOHLM4ZWLORKDPKC7EBYRY23VAC
LWG4EVVTDO3IO46PTT5LGO7A2KSFPGZXSRNI7G3ZMXIAZACBB4IQC
OJD2AWBJJRUXYVF5BBYWSRRIE5A7LKJDL6YQCQZ3APEBIB6GATFAC
NDMM44EV2XD5RP7J4Q25ZX52LUP7WOMTKO3C2PDXW7IWFEVWUW6QC
5RSETDN4QCQLU7Z55EFXSW27CBEW6HD2MVD2MKB6WDBXIKXFHKNQC
E4HFJ4L4PAGV7R7EXVG2B2CWDGGW7XWU4D37VURZ66HZ3ILHCFUAC
63VXWIHIAKGK7J4VTNRUAG2V32N2QUSWFELB6GD34S54FGRWAPCQC
NAAQ2HMF7NXGJDRPXATVAGGZWL5MAIQWF4K5S23VFYBPOPZUXJZAC
ZBUC3VBT42SDAG42OCUX7MTT6GNPX2GEGWU2QIUYAY4NMX33IGLAC
SE6MCCXTIXSGMAH5EL7EPDXIQKV6THCCY2H4OQJJQOHCUQAWE5VQC
PK7ZUXD7ELS4V6SNYYFWP45JKWKJOVWBGFDRSFY3LP47IU2M55BAC
destination = (await cloudinary.uploader.upload(response, {public_id: response.substring(5), unique_filename: false})).secure_url;
response = response.split('\n');
[x, y] = response[1].split('x');
try {
destination = (await cloudinary.uploader.upload(response[0], {public_id: response[0].substring(5), unique_filename: false})).secure_url;
} catch(e) {
console.error(e);
console.error('skipping image upload due to cloudinary outage')
return;
}
await postgres.query('update product_image set destination = $1 where product_image_id = $2', [
(await cloudinary.uploader.upload(response, {public_id: response.substring(5), unique_filename: false})).secure_url,
product_images[0].product_image_id
]);
response = response.split('\n');
try {
await postgres.query('update product_image set destination = $1, x = $2, y = $3 where product_image_id = $2', [
(await cloudinary.uploader.upload(response[0], {public_id: response[0].substring(5), unique_filename: false})).secure_url,
product_images[0].product_image_id, ...response[1].split('x')
]);
} catch(e) {
console.error(e);
console.error('skipping image upload due to cloudinary outage?')
return;
}