mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 06:25:51 +01:00
api url is only issues
This commit is contained in:
@@ -15,7 +15,7 @@ case class ApiComment(
|
|||||||
body: String,
|
body: String,
|
||||||
created_at: Date,
|
created_at: Date,
|
||||||
updated_at: Date)(repositoryName: RepositoryName, issueId: Int, issueOrPullRequest: IssueOrPullRequest){
|
updated_at: Date)(repositoryName: RepositoryName, issueId: Int, issueOrPullRequest: IssueOrPullRequest){
|
||||||
val html_url = ApiPath(s"/${repositoryName.fullName}/${issueOrPullRequest.html}/${issueId}#comment-${id}")
|
val html_url = ApiPath(s"/${repositoryName.fullName}/${issueOrPullRequest.path}/${issueId}#comment-${id}")
|
||||||
}
|
}
|
||||||
|
|
||||||
object ApiComment{
|
object ApiComment{
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ case class ApiIssue(
|
|||||||
created_at: Date,
|
created_at: Date,
|
||||||
updated_at: Date,
|
updated_at: Date,
|
||||||
body: String)(repositoryName: RepositoryName, issueOrPullRequest: IssueOrPullRequest){
|
body: String)(repositoryName: RepositoryName, issueOrPullRequest: IssueOrPullRequest){
|
||||||
val comments_url = ApiPath(s"/api/v3/repos/${repositoryName.fullName}/${issueOrPullRequest.api}/${number}/comments")
|
val comments_url = ApiPath(s"/api/v3/repos/${repositoryName.fullName}/issues/${number}/comments")
|
||||||
val html_url = ApiPath(s"/${repositoryName.fullName}/${issueOrPullRequest.html}/${number}")
|
val html_url = ApiPath(s"/${repositoryName.fullName}/${issueOrPullRequest.path}/${number}")
|
||||||
}
|
}
|
||||||
|
|
||||||
object ApiIssue{
|
object ApiIssue{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package gitbucket.core.api
|
package gitbucket.core.api
|
||||||
|
|
||||||
case class IssueOrPullRequest(isPullRequest:Boolean){
|
case class IssueOrPullRequest(isPullRequest:Boolean){
|
||||||
val (html, api) = if(isPullRequest){ ("pull","pulls") }else{ ("issues","issues") }
|
val path = if(isPullRequest){ "pull" }else{ "issues" }
|
||||||
}
|
}
|
||||||
@@ -200,7 +200,7 @@ class JsonFormatSpec extends Specification {
|
|||||||
"title": "Found a bug",
|
"title": "Found a bug",
|
||||||
"body": "I'm having a problem with this.",
|
"body": "I'm having a problem with this.",
|
||||||
"user": $apiUserJson,
|
"user": $apiUserJson,
|
||||||
"comments_url": "${context.baseUrl}/api/v3/repos/octocat/Hello-World/pulls/1347/comments",
|
"comments_url": "${context.baseUrl}/api/v3/repos/octocat/Hello-World/issues/1347/comments",
|
||||||
"html_url": "${context.baseUrl}/octocat/Hello-World/pull/1347",
|
"html_url": "${context.baseUrl}/octocat/Hello-World/pull/1347",
|
||||||
"created_at": "2011-04-14T16:00:49Z",
|
"created_at": "2011-04-14T16:00:49Z",
|
||||||
"updated_at": "2011-04-14T16:00:49Z"
|
"updated_at": "2011-04-14T16:00:49Z"
|
||||||
|
|||||||
Reference in New Issue
Block a user