diff options
author | Philidor Green <fishbullet@users.noreply.github.com> | 2020-03-28 16:56:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-28 21:56:11 +0800 |
commit | 470274204e6714c8062a49fa9e96450a67452133 (patch) | |
tree | d71862b5c333afc74dee419c4e61452e6a01c6ec /internal/db | |
parent | af0cfe112b4fcab674494dfb1a716a4bede2d7ca (diff) |
api: support get releases endpoint (#6026)
Diffstat (limited to 'internal/db')
-rw-r--r-- | internal/db/release.go | 6 |
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) |