Skip to content

Commit

Permalink
support moving back to the special uncategorized folder
Browse files Browse the repository at this point in the history
  • Loading branch information
adelowo committed Oct 1, 2019
1 parent 306ec7c commit 5c334d7
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions routers/repo/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ func UpdateIssueProject(ctx *context.Context) {
})
}

// MoveIssueAcrossBoards move a card from one board to another in a project
func MoveIssueAcrossBoards(ctx *context.Context) {

if ctx.User == nil {
Expand All @@ -358,14 +359,26 @@ func MoveIssueAcrossBoards(ctx *context.Context) {
return
}

board, err := models.GetProjectBoard(ctx.Repo.Repository.ID, p.ID, ctx.ParamsInt64(":boardID"))
if err != nil {
if models.IsErrProjectBoardNotExist(err) {
ctx.NotFound("", nil)
} else {
ctx.ServerError("GetProjectBoard", err)
var board *models.ProjectBoard

if ctx.ParamsInt64(":boardID") == 0 {

board = &models.ProjectBoard{
ID: 0,
ProjectID: 0,
Title: ctx.Tr("repo.projects.type.uncategorized"),
}

} else {
board, err = models.GetProjectBoard(ctx.Repo.Repository.ID, p.ID, ctx.ParamsInt64(":boardID"))
if err != nil {
if models.IsErrProjectBoardNotExist(err) {
ctx.NotFound("", nil)
} else {
ctx.ServerError("GetProjectBoard", err)
}
return
}
return
}

issue, err := models.GetIssueByID(ctx.ParamsInt64(":index"))
Expand Down

0 comments on commit 5c334d7

Please sign in to comment.