Open RicoElectrico opened 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?
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
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.
Okay then. Backend will expose methods for AED creation and edits.
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.