Assign, milestone and labels are available in Issue creation.

This commit is contained in:
takezoe
2013-07-02 10:57:37 +09:00
parent c13e03f62f
commit 373685b86d
3 changed files with 40 additions and 14 deletions

View File

@@ -160,8 +160,8 @@ trait IssuesService {
} exists, condition.labels.nonEmpty)
}
def createIssue(owner: String, repository: String, loginUser: String,
title: String, content: Option[String]) =
def createIssue(owner: String, repository: String, loginUser: String, title: String, content: Option[String],
assignedUserName: Option[String], milestoneId: Option[Int]) =
// next id number
sql"SELECT ISSUE_ID + 1 FROM ISSUE_ID WHERE USER_NAME = $owner AND REPOSITORY_NAME = $repository FOR UPDATE".as[Int]
.firstOption.filter { id =>
@@ -170,8 +170,8 @@ trait IssuesService {
repository,
id,
loginUser,
None,
None,
milestoneId,
assignedUserName,
title,
content,
false,
@@ -184,6 +184,9 @@ trait IssuesService {
}.map(_.issueId).update(id) > 0
} get
def registerIssueLabel(owner: String, repository: String, issueId: Int, labelId: Int): Unit =
IssueLabels.* insert (IssueLabel(owner, repository, issueId, labelId))
def createComment(owner: String, repository: String, loginUser: String,
issueId: Int, content: String, action: Option[String]) =
IssueComments.autoInc insert (