changes with app variant
This commit is contained in:
@@ -406,8 +406,17 @@ func (ctl *ProductController) GetProductByVariant(c *fiber.Ctx) error {
|
||||
tenantID, _ := strconv.Atoi(c.Query("tenantid"))
|
||||
variantid, _ := strconv.Atoi(c.Query("variantid"))
|
||||
locationID, _ := strconv.Atoi(c.Query("locationid"))
|
||||
// `productid` is the parameter the ordering screen should send.
|
||||
//
|
||||
// With it the caller no longer has to know whether the thing it tapped has
|
||||
// sizes: a product in a variant group comes back with the whole group to
|
||||
// choose from, a product in none comes back on its own. Previously only
|
||||
// `variantid` was accepted, so an ungrouped product — `variants = 0`, which
|
||||
// is most of them — could not be requested at all and the order screen had
|
||||
// nothing to work with.
|
||||
productID, _ := strconv.Atoi(c.Query("productid"))
|
||||
|
||||
result, err := ctl.productService.GetProductByVariant(tenantID, variantid, locationID)
|
||||
result, err := ctl.productService.GetProductByVariant(tenantID, variantid, locationID, productID)
|
||||
|
||||
if err != nil {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user