Ajuster message de /v1/seed selon len(new_buckets)
This commit is contained in:
parent
7accc596c7
commit
6cc6d75afd
1 changed files with 8 additions and 1 deletions
|
@ -199,9 +199,16 @@ func handleV1Seed(c echo.Context) error {
|
||||||
}
|
}
|
||||||
new_buckets = append(new_buckets, bucket)
|
new_buckets = append(new_buckets, bucket)
|
||||||
}
|
}
|
||||||
|
var message string
|
||||||
|
if len(new_buckets) == 0 {
|
||||||
|
message = "All buckets already exist"
|
||||||
|
|
||||||
|
} else {
|
||||||
|
message = "Buckets successfully created"
|
||||||
|
}
|
||||||
|
|
||||||
return c.JSON(http.StatusOK, map[string]interface{}{
|
return c.JSON(http.StatusOK, map[string]interface{}{
|
||||||
"message": "Buckets successfully created",
|
"message": message,
|
||||||
"buckets": new_buckets,
|
"buckets": new_buckets,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue