Hamzakam / Peerhub

https://github.com/pandeyxamit/MPG1
0 stars 2 forks source link

community endpoint should allow search by community name #49

Closed Hamzakam closed 2 years ago

Hamzakam commented 2 years ago

So, if a user goes to a community say sports, the url will need to be of form https://peerhub.com/community/<objectid of sport community> https://peerhub.com/sub/<objectid of sport community>. I think this is not good practice as something like community should be more accessible and names are already unique so i believe it should be https://peerhub.com/community/sportshttps://peerhub.com/sub/sports.. We will allow both of these ways to access a specific community so user has a choice and it is easy to implement. EDIT: community = sub

Hamzakam commented 2 years ago

So, rather than implementing a new endpoint, we can use query parameters. So, the url will be https://peerhub.com/sub/sports but the request the client will send be https://peerhub.com/api/sub?name=sports. In this case, the match will be fixed and wrong url will result in 404.

Hamzakam commented 2 years ago

I am closing this issue as implemention on frontend will entail routing and a new issue will created in that case.