From 2287f00e2926531bbcfd8ef5cce91a642a0c79ce Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Fri, 9 Jun 2023 01:11:55 -0400 Subject: [PATCH] Retirer webhandlers#GetMembre() --- web/webhandlers/handlers.go | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/web/webhandlers/handlers.go b/web/webhandlers/handlers.go index dce8399..8376dd8 100644 --- a/web/webhandlers/handlers.go +++ b/web/webhandlers/handlers.go @@ -1,43 +1,11 @@ package webhandlers import ( - "fmt" "net/http" - "git.agecem.com/agecem/bottin/v5/data" "github.com/labstack/echo/v4" ) func GetIndex(c echo.Context) error { return c.Render(http.StatusOK, "index-html", nil) } - -func GetMembre(c echo.Context) error { - apiClient := data.NewApiClientFromViper() - - membreID := c.QueryParam("membre_id") - - membre, err := apiClient.GetMembre(membreID) - if err != nil { - return c.Render(http.StatusBadRequest, "index-html", struct { - Result string - }{ - Result: fmt.Sprintln("👎", err.Error()), - }) - } - - membreResult := fmt.Sprintf(`👍 - Membre trouvéE: [%s]`, membre.ID) - - if membre.PreferedName != "" { - membreResult = fmt.Sprintf("%s -> %s", membreResult, membre.PreferedName) - } else { - membreResult = fmt.Sprintf("%s -> %s, %s", membreResult, membre.LastName, membre.FirstName) - } - - return c.Render(http.StatusOK, "index-html", struct { - Result string - }{ - Result: membreResult, - }) -}