Ajuster message de /v1/seed selon len(new_buckets)

This commit is contained in:
Victor Lacasse-Beaudoin 2023-04-24 16:30:06 -04:00
parent 7accc596c7
commit 6cc6d75afd

View file

@ -199,9 +199,16 @@ func handleV1Seed(c echo.Context) error {
}
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{}{
"message": "Buckets successfully created",
"message": message,
"buckets": new_buckets,
})
}