normativeai / backend

GNU General Public License v3.0
3 stars 3 forks source link

Get list of all theories #19

Closed lex-lex closed 5 years ago

lex-lex commented 5 years ago

Hi Tomer,

is there a method to get a summary/list of all available theories (not just by the current user)? If I understand the test cases of the back end, api/theories will just return a summary of the theories of the current user. However, for normativeai/frontend#12 I will need to get a list of all available theories for cloning. Can you implement that?

shaolintl commented 5 years ago

We have talked about having the ability to return all theories which correspond to some keyword or tag. I.e. one can use tags in the description of theories (@tag privacy-law) and then you can retrieve all theories with this tag GET /api/theories/find?query=blah

The query is a regex.

shaolintl commented 5 years ago

GET /api/theories/find?query=privacy-law

shaolintl commented 5 years ago

Please tell me if this functionality is not enough.

lex-lex commented 5 years ago

What is returned for GET /api/theories/find?query=, i.e. the empty search string?

shaolintl commented 5 years ago

You are right. Using the regular expression .* should return everything. GET /api/theories/find?query=.*