GetOrganizations godoc @Security ApiKey @Summary Get organizations @Description get organizations @Tags Organization @Accept json @Produce json @Success 200 {object} types.Response{data=[]types.Organization} "OK" @Failure 500 {object} types.APIInternalServe
(ctx *gin.Context)
| 112 | // @Failure 500 {object} types.APIInternalServerError "Internal server error" |
| 113 | // @Router /organizations [get] |
| 114 | func (h *OrganizationHandler) Index(ctx *gin.Context) { |
| 115 | username := httpbase.GetCurrentUser(ctx) |
| 116 | orgs, err := h.c.Index(ctx, username) |
| 117 | if err != nil { |
| 118 | slog.Error("Failed to get organizations", slog.Any("error", err)) |
| 119 | httpbase.ServerError(ctx, err) |
| 120 | return |
| 121 | } |
| 122 | |
| 123 | slog.Info("Get organizations succeed") |
| 124 | httpbase.OK(ctx, orgs) |
| 125 | } |
| 126 | |
| 127 | // DeleteOrganization godoc |
| 128 | // @Security ApiKey |
nothing calls this directly
no test coverage detected