Hi guys.
I made a query, got the data, and changes some value.
Then I used wixData.update to save the changes.
The problem is that the image was saved as an object with 4 keys (uri, title, width and height) instead of a url.
So to solve that I parsed the data before update, like that:
let imageUri = updatedData.image.uri;
let imageTitle = updatedData.image.title;
let imageWidth = updatedData.image.width;
let imageHeight = updatedData.image.height;
updatedData.image = `wix:image:\//v1/${imageUri}/${encodeURI(imageTitle)}#originWidth=${imageWidth}&originHeight=${imageHeight}`;
and it worked well, but I’m wondering if there’s a simpler and more straight forward way to do it.
Is there?