GetOrganization godoc @Security ApiKey @Summary Get organization info @Tags Organization @Accept json @Produce json @Param current_user query string false "the op user" @param namespace path string true "namespace" @Success 200 {object} types.Response
(ctx *gin.Context)
| 85 | // @Failure 500 {object} types.APIInternalServerError "Internal server error" |
| 86 | // @Router /organization/{namespace} [get] |
| 87 | func (h *OrganizationHandler) Get(ctx *gin.Context) { |
| 88 | orgName := ctx.Param("namespace") |
| 89 | if len(orgName) == 0 { |
| 90 | httpbase.BadRequest(ctx, "organization name is empty") |
| 91 | return |
| 92 | } |
| 93 | org, err := h.c.Get(ctx, orgName) |
| 94 | if err != nil { |
| 95 | slog.Error("Failed to get organization", slog.Any("error", err), slog.String("org_path", orgName)) |
| 96 | httpbase.ServerError(ctx, err) |
| 97 | return |
| 98 | } |
| 99 | |
| 100 | slog.Info("Get organization succeed", slog.String("org_path", org.Name)) |
| 101 | httpbase.OK(ctx, org) |
| 102 | } |
| 103 | |
| 104 | // GetOrganizations godoc |
| 105 | // @Security ApiKey |
nothing calls this directly
no test coverage detected