openstreetmap-polska / openaedmap-frontend

Map which shows locations of defibrillators (AEDs) and allows adding new ones.
https://OpenAEDMap.org
MIT License
31 stars 18 forks source link

Allow adding photos to an AED being added, not just to existing ones #172

Open RicoElectrico opened 1 year ago

RicoElectrico commented 1 year ago

Feels like an oversight 😅 However, the current API requires node ID which is not present at the upload stage. This would mean splitting the upload into 3 parts: uploading a node to the OSM API to get the ID, adding a photo to our backend and then editing the node to include the image=* tag. (the last happens on the backend). This feels extremely flimsy.

Maybe we could just make the backend upload the AED on behalf of the user? To be stateless, ditch the changeset opening and just use 1 changeset per AED. Not optimal, but nobody will use our page to bulk load AEDs.

Zaczero commented 1 year ago

So backend should provide interface for automatic handling of node creation/updates (frontend sends the node diff), with an option to upload an image alongside of it. Correct?

Zaczero commented 10 months ago

It seems like frontend uses OSM API directly, and backend is not involved in the AED creation process at all. Perhaps this should be unified so the backend performs the creation instead? @starsep

starsep commented 10 months ago

I agree. That will allow to create AED and upload photo at once. Either in 1 or 2 requests. I would prefer one which would create AED with optional photo data as parameter. We also have to support editing existing AED - changing tags and potentially adding a photo.

Zaczero commented 10 months ago

Okay then. Backend will expose methods for AED creation and edits.