image upload fixes + some API changes

This commit is contained in:
azivner
2018-08-11 19:45:55 +02:00
parent 9e96272eb3
commit 0f42c396f3
6 changed files with 36 additions and 8 deletions

View File

@@ -62,7 +62,8 @@ async function updateEntity(entity) {
delete clone.isOwned;
for (const key in clone) {
if (clone[key] !== null && typeof clone[key] === 'object') {
// !isBuffer is for images and attachments
if (clone[key] !== null && typeof clone[key] === 'object' && !Buffer.isBuffer(clone[key])) {
clone[key] = JSON.stringify(clone[key]);
}
}