From f30cc9faa93935f5afb7a38354e5381d5e8825bf Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 19 Apr 2023 23:28:28 +0900 Subject: Add unset default project column (#23531) Close: https://github.com/go-gitea/gitea/issues/23401 --- routers/web/org/projects.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'routers/web/org') diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go index ed6a2e645f..37212179c9 100644 --- a/routers/web/org/projects.go +++ b/routers/web/org/projects.go @@ -610,6 +610,23 @@ func SetDefaultProjectBoard(ctx *context.Context) { }) } +// UnsetDefaultProjectBoard unset default board for uncategorized issues/pulls +func UnsetDefaultProjectBoard(ctx *context.Context) { + project, _ := CheckProjectBoardChangePermissions(ctx) + if ctx.Written() { + return + } + + if err := project_model.SetDefaultBoard(project.ID, 0); err != nil { + ctx.ServerError("SetDefaultBoard", err) + return + } + + ctx.JSON(http.StatusOK, map[string]interface{}{ + "ok": true, + }) +} + // MoveIssues moves or keeps issues in a column and sorts them inside that column func MoveIssues(ctx *context.Context) { if ctx.Doer == nil { -- cgit v1.2.3