tomoakley / freemeals.uk

MIT License
9 stars 10 forks source link

URL structure is very limiting #87

Open freaksauce opened 3 years ago

freaksauce commented 3 years ago

If you were to change the url structure to include the town/city users could send on a link. Using /provider/1 will never allow sharing of links because it relies on the data being filtered first.

eg. /bath to then filter and return the vendor 'Bombay Balti'

lmjcbs commented 3 years ago

It would be a nice QOL upgrade. However, a few key tasks would have to be done to get this working in the apps current state.

I think the difficulty comes from ensuring it's valid for every location. Consider the two locations "Barrow-in-Furness" and "Barton upon humber" that currently exist in the app's data. Adding hyphens in place of spaces in a location to get a URL, would mean that a decoder that adds in spaces in place of hyphens would invalidate some locations ex. "Barrow in Furness".

freaksauce commented 3 years ago

Yes I agree it's not a small task, the easiest part would probably be stripping the hyphens and spaces from all city/town values in both the url and api data in order to do a comparison check

tomoakley commented 3 years ago

yeah we need to do this. I was thinking of using the coordinates in the path, e.g /<lat>,<lng>/provider/name but your method is maybe better.