fix media update

This commit is contained in:
lesion
2023-06-06 14:13:17 +02:00
parent 01dbb1b2d7
commit 9ce9a1aad9

View File

@@ -454,9 +454,7 @@ const eventController = {
}] }]
} else if (!body.image) { } else if (!body.image) {
eventDetails.media = [] eventDetails.media = []
} } else if (body.image_focalpoint && event.media.length) {
if (body.image_focalpoint && event.media.length) {
let focalpoint = body.image_focalpoint ? body.image_focalpoint.split(',') : ['0', '0'] let focalpoint = body.image_focalpoint ? body.image_focalpoint.split(',') : ['0', '0']
focalpoint = [parseFloat(parseFloat(focalpoint[0]).toFixed(2)), parseFloat(parseFloat(focalpoint[1]).toFixed(2))] focalpoint = [parseFloat(parseFloat(focalpoint[0]).toFixed(2)), parseFloat(parseFloat(focalpoint[1]).toFixed(2))]
eventDetails.media = [{ ...event.media[0], focalpoint }] // [0].focalpoint = focalpoint eventDetails.media = [{ ...event.media[0], focalpoint }] // [0].focalpoint = focalpoint