DeleteOrganization godoc @Security ApiKey @Summary Delete organization @Description delete organization @Tags Organization @Accept json @Produce json @Param namespace path string true "namespace" @Param current_user query string false "the op user" @Param
(ctx *gin.Context)
| 138 | // @Failure 500 {object} types.APIInternalServerError "Internal server error" |
| 139 | // @Router /organization/{namespace} [delete] |
| 140 | func (h *OrganizationHandler) Delete(ctx *gin.Context) { |
| 141 | var req types.DeleteOrgReq |
| 142 | currentUser := httpbase.GetCurrentUser(ctx) |
| 143 | if currentUser == "" { |
| 144 | httpbase.UnauthorizedError(ctx, errors.New("user not found, please login first")) |
| 145 | return |
| 146 | } |
| 147 | req.CurrentUser = currentUser |
| 148 | req.Name = ctx.Param("namespace") |
| 149 | err := h.c.Delete(ctx, &req) |
| 150 | if err != nil { |
| 151 | slog.Error("Failed to delete organizations", slog.Any("error", err)) |
| 152 | httpbase.ServerError(ctx, err) |
| 153 | return |
| 154 | } |
| 155 | |
| 156 | slog.Info("Delete organizations succeed", slog.String("org_name", req.Name)) |
| 157 | httpbase.OK(ctx, nil) |
| 158 | } |
| 159 | |
| 160 | // UpdateOrganization godoc |
| 161 | // @Security ApiKey |
nothing calls this directly
no test coverage detected