-
-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OBPIH-4769 Add list endpoint in Product API #3489
Conversation
@@ -249,7 +249,20 @@ class BootStrap { | |||
|
|||
|
|||
JSON.registerObjectMarshaller(Product) { Product product -> | |||
return product.toJson() | |||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we moving these out of the Product class? I am trying to move all of these into the domain classes.
@@ -46,6 +46,35 @@ class UrlMappings { | |||
controller = { "categoryApi" } | |||
action = [GET: "read", POST: "save", PUT: "save", DELETE: "delete"] | |||
} | |||
|
|||
// Category options for filters on product list page | |||
"/api/categoryOptions"(parseRequest: true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not create their own APIs using the BaseDomainApiController? Or why not just use the generic API for these?
|
||
def products = productService.getProducts(category, catalogs, tags, includeInactive, params) | ||
|
||
if (params.format == 'csv') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need CSV handling on the API?
@@ -56,7 +93,7 @@ class ProductApiController extends BaseDomainApiController { | |||
render([data: data] as JSON) | |||
} | |||
|
|||
def list = { | |||
def search = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be a breaking change. The product API is already being used externally for things like the mobile app and other API clients so this might be a bad idea. In the future, please don't change existing endpoints unless we've had a discussion.
No description provided.