add some changes
This commit is contained in:
@@ -156,6 +156,19 @@ func (h *Handler) ListClients(c *gin.Context) {
|
||||
// Parse search query
|
||||
opts.Search = c.Query("search")
|
||||
|
||||
// Parse category filter
|
||||
if category := c.Query("category"); category != "" {
|
||||
// Validate category
|
||||
validCategories := map[string]bool{
|
||||
"File": true,
|
||||
"Database": true,
|
||||
"Virtual": true,
|
||||
}
|
||||
if validCategories[category] {
|
||||
opts.Category = category
|
||||
}
|
||||
}
|
||||
|
||||
clients, err := h.service.ListClients(c.Request.Context(), opts)
|
||||
if err != nil {
|
||||
h.logger.Error("Failed to list clients", "error", err)
|
||||
|
||||
Reference in New Issue
Block a user