mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-18 17:00:02 +02:00
[API] Pull Requests (#248)
This commit is contained in:
parent
d7ed78a919
commit
0f05470cb8
6 changed files with 592 additions and 0 deletions
|
@ -170,6 +170,22 @@ func (issue *Issue) HTMLURL() string {
|
|||
return fmt.Sprintf("%s/%s/%d", issue.Repo.HTMLURL(), path, issue.Index)
|
||||
}
|
||||
|
||||
// DiffURL returns the absolute URL to this diff
|
||||
func (issue *Issue) DiffURL() string {
|
||||
if issue.IsPull {
|
||||
return fmt.Sprintf("%s/pulls/%d.diff", issue.Repo.HTMLURL(), issue.Index)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// PatchURL returns the absolute URL to this patch
|
||||
func (issue *Issue) PatchURL() string {
|
||||
if issue.IsPull {
|
||||
return fmt.Sprintf("%s/pulls/%d.patch", issue.Repo.HTMLURL(), issue.Index)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// State returns string representation of issue status.
|
||||
func (issue *Issue) State() api.StateType {
|
||||
if issue.IsClosed {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue