feat(seller): connect products list to marketplace API (F2)
This commit is contained in:
parent
7caf082078
commit
590cede6c2
1 changed files with 10 additions and 1 deletions
|
|
@ -227,7 +227,16 @@ func (h *MarketplaceHandler) ListProducts(c *gin.Context) {
|
|||
filters["status"] = status
|
||||
}
|
||||
if sellerID := c.Query("seller_id"); sellerID != "" {
|
||||
filters["seller_id"] = sellerID
|
||||
if sellerID == "me" {
|
||||
uid, ok := GetUserIDUUID(c)
|
||||
if !ok {
|
||||
response.Unauthorized(c, "Authentication required to filter by own products")
|
||||
return
|
||||
}
|
||||
filters["seller_id"] = uid.String()
|
||||
} else {
|
||||
filters["seller_id"] = sellerID
|
||||
}
|
||||
}
|
||||
if q := c.Query("q"); q != "" {
|
||||
filters["search"] = q
|
||||
|
|
|
|||
Loading…
Reference in a new issue