summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-03-14 21:10:35 -0400
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2017-03-15 02:10:35 +0100
commit09fe4a2ae9dfa8b3bc8a5039d0feab1e1a34d07b (patch)
treed7c595f4b004e2bfe70fc363a8258b0b26cae41b /models/issue.go
parent021904e4e65804baa67b38e193e15aa37a391c60 (diff)
downloadgitea-09fe4a2ae9dfa8b3bc8a5039d0feab1e1a34d07b.tar.gz
gitea-09fe4a2ae9dfa8b3bc8a5039d0feab1e1a34d07b.zip
Batch updates for issues (#926)
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go
index eab494bdea..347598300e 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -1002,6 +1002,16 @@ func GetIssueByID(id int64) (*Issue, error) {
return getIssueByID(x, id)
}
+func getIssuesByIDs(e Engine, issueIDs []int64) ([]*Issue, error) {
+ issues := make([]*Issue, 0, 10)
+ return issues, e.In("id", issueIDs).Find(&issues)
+}
+
+// GetIssuesByIDs return issues with the given IDs.
+func GetIssuesByIDs(issueIDs []int64) ([]*Issue, error) {
+ return getIssuesByIDs(x, issueIDs)
+}
+
// IssuesOptions represents options of an issue.
type IssuesOptions struct {
RepoID int64