mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
fix: is depletion hidden attempt 2
This commit is contained in:
@@ -231,14 +231,14 @@ func (s productService) GetAll(c *fiber.Ctx, params *validation.Query) ([]entity
|
|||||||
db = s.withRelations(db)
|
db = s.withRelations(db)
|
||||||
|
|
||||||
includeAll := params.IncludeAll != nil && *params.IncludeAll
|
includeAll := params.IncludeAll != nil && *params.IncludeAll
|
||||||
// Avoid overlapping behavior: when is_depletion filter is used, keep visible-only catalog.
|
if params.IsDepletion != nil && *params.IsDepletion {
|
||||||
if params.IsDepletion != nil {
|
// Auto-expand visibility for depletion catalog so FE doesn't need include_all=true.
|
||||||
includeAll = false
|
includeAll = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default: show only visible products.
|
// Default: show only visible products.
|
||||||
// include_all=true can be used to fetch all records (including hidden/system products),
|
// include_all=true can be used to fetch all records (including hidden/system products).
|
||||||
// except when is_depletion is explicitly requested.
|
// is_depletion, when provided, is composed as an additional flag filter.
|
||||||
if !includeAll {
|
if !includeAll {
|
||||||
db = db.Where("is_visible = ?", true)
|
db = db.Where("is_visible = ?", true)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user