aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-08 17:17:45 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-08 17:17:45 -0400
commita742ee543ef3faf6374625c9c6d065c0a46b5549 (patch)
tree4afdfdabfb284e32109190fd51f4ff7e8cce7969 /models/issue.go
parente86728340654b18a657a65920c16e28a1b00cca7 (diff)
downloadgitea-a742ee543ef3faf6374625c9c6d065c0a46b5549.tar.gz
gitea-a742ee543ef3faf6374625c9c6d065c0a46b5549.zip
Add change assignee back end
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go
index 525e75f2c3..a84fb0541e 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -338,6 +338,18 @@ func UpdateIssueUserPairsByStatus(iid int64, isClosed bool) error {
return err
}
+// UpdateIssueUserPairByAssignee updates issue-user pair for assigning.
+func UpdateIssueUserPairByAssignee(aid, iid int64) error {
+ rawSql := "UPDATE `issue_user` SET is_assigned = ? WHERE issue_id = ?"
+ if _, err := orm.Exec(rawSql, false, iid); err != nil {
+ return err
+ }
+
+ rawSql = "UPDATE `issue_user` SET is_assigned = true WHERE uid = ? AND issue_id = ?"
+ _, err := orm.Exec(rawSql, true, aid, iid)
+ return err
+}
+
// UpdateIssueUserPairByRead updates issue-user pair for reading.
func UpdateIssueUserPairByRead(uid, iid int64) error {
rawSql := "UPDATE `issue_user` SET is_read = ? WHERE uid = ? AND issue_id = ?"