xinra-oss / review-community

Other
2 stars 0 forks source link

API for reviews #32

Closed erikhofer closed 6 years ago

erikhofer commented 7 years ago
flexiglas commented 7 years ago

@erikhofer How should we pass the sort and order parameter? In my latest commit I pass them as Strings in Requested Headers and later I check their content to decide which sort function to use. I don't think this is how it should be.

erikhofer commented 7 years ago

@fknebel This should be done with a query parameter using @RequestParam. Example URL: /product/5/review?orderBy=rating.

Instead of string values we should use enums.

I think we can omit the ordering direction for now, there is not really a point in sorting by lowest rating or least recent date.

Ordering must be done at database level. At some point we may not want to load all reviews at once but e.g. the top 10.