fix: use spot.latitude/longitude for feedback (geometry no longer serialized)
This commit is contained in:
@@ -102,10 +102,9 @@ function FeedbackButton({ spot }) {
|
|||||||
const submit = async (hasSeaweed) => {
|
const submit = async (hasSeaweed) => {
|
||||||
if (loading || sent) return;
|
if (loading || sent) return;
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const coords = spot.geometry?.coordinates;
|
if (spot.latitude != null && spot.longitude != null) {
|
||||||
if (coords) {
|
|
||||||
await api.feedback.create({
|
await api.feedback.create({
|
||||||
lat: coords[1], lng: coords[0],
|
lat: spot.latitude, lng: spot.longitude,
|
||||||
hasSeaweed, coastalPointId: spot.id,
|
hasSeaweed, coastalPointId: spot.id,
|
||||||
}).catch(console.error);
|
}).catch(console.error);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user