aboutsummaryrefslogtreecommitdiff
path: root/internal/db
diff options
context:
space:
mode:
authorPhilidor Green <fishbullet@users.noreply.github.com>2020-03-28 16:56:11 +0300
committerGitHub <noreply@github.com>2020-03-28 21:56:11 +0800
commit470274204e6714c8062a49fa9e96450a67452133 (patch)
treed71862b5c333afc74dee419c4e61452e6a01c6ec /internal/db
parentaf0cfe112b4fcab674494dfb1a716a4bede2d7ca (diff)
api: support get releases endpoint (#6026)
Diffstat (limited to 'internal/db')
-rw-r--r--internal/db/release.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/db/release.go b/internal/db/release.go
index 71a72dae..7ec558b8 100644
--- a/internal/db/release.go
+++ b/internal/db/release.go
@@ -267,6 +267,12 @@ func GetPublishedReleasesByRepoID(repoID int64, matches ...string) ([]*Release,
return releases, sess.Find(&releases, new(Release))
}
+// GetReleasesByRepoID returns a list of all releases (including drafts) of given repository.
+func GetReleasesByRepoID(repoID int64) ([]*Release, error) {
+ releases := make([]*Release, 0)
+ return releases, x.Where("repo_id = ?", repoID).Find(&releases)
+}
+
// GetDraftReleasesByRepoID returns all draft releases of repository.
func GetDraftReleasesByRepoID(repoID int64) ([]*Release, error) {
releases := make([]*Release, 0)