update limit popular products

This commit is contained in:
aditya.siregar 2025-06-11 22:21:20 +07:00
parent fa8f0ad380
commit 58d3b32c40

View File

@ -426,13 +426,9 @@ func (h *Handler) GetPopularProducts(c *gin.Context) {
period := c.Query("period") period := c.Query("period")
status := order2.Paid.String() status := order2.Paid.String()
limitStr := c.Query("limit")
sortBy := c.Query("sort_by") sortBy := c.Query("sort_by")
limit, err := strconv.Atoi(limitStr) limit := 1000
if err != nil {
limit = 10 // default limit
}
if period != "d" && period != "w" && period != "m" { if period != "d" && period != "w" && period != "m" {
period = "d" period = "d"