ScienceForChange / SoundCollect_backend

0 stars 0 forks source link

empty array vs NULL value for images #36

Open OtariOboladzeSfC opened 1 month ago

OtariOboladzeSfC commented 1 month ago

Database should save empty array "[]" instead of NULL if there are no images associated with the observation

CarlosMillanSfC commented 2 weeks ago

Hola, revisando las issues he visto esta y esto podría solucionarse con este cambio en la clase api/app/Http/Resources/ObservationResource.php

[...]
'images' => $this->images ?? [],
[...]

https://github.com/ScienceForChange/SoundCollect_backend/blob/ca7d386df8b4447a5a6b39bc07ec0e6a3ec722d8/api/app/Http/Resources/ObservationResource.php#L35 No hago el cambio ni nada porque no sé si puede romper algo en front y tal, me dices @OtariOboladzeSfC