From 6cc6d75afd7e04e4fc9861fbe2bfb10f5f3a51a9 Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Mon, 24 Apr 2023 16:30:06 -0400 Subject: [PATCH] Ajuster message de /v1/seed selon len(new_buckets) --- cmd/server.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/server.go b/cmd/server.go index 4e7d2ad..3a01df0 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -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, }) }