api url is only issues

This commit is contained in:
nazoking
2015-10-02 00:33:23 +09:00
parent 0283ec574d
commit bf64f6b4f4
4 changed files with 5 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ case class ApiComment(
body: String,
created_at: Date,
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{

View File

@@ -18,8 +18,8 @@ case class ApiIssue(
created_at: Date,
updated_at: Date,
body: String)(repositoryName: RepositoryName, issueOrPullRequest: IssueOrPullRequest){
val comments_url = ApiPath(s"/api/v3/repos/${repositoryName.fullName}/${issueOrPullRequest.api}/${number}/comments")
val html_url = ApiPath(s"/${repositoryName.fullName}/${issueOrPullRequest.html}/${number}")
val comments_url = ApiPath(s"/api/v3/repos/${repositoryName.fullName}/issues/${number}/comments")
val html_url = ApiPath(s"/${repositoryName.fullName}/${issueOrPullRequest.path}/${number}")
}
object ApiIssue{

View File

@@ -1,5 +1,5 @@
package gitbucket.core.api
case class IssueOrPullRequest(isPullRequest:Boolean){
val (html, api) = if(isPullRequest){ ("pull","pulls") }else{ ("issues","issues") }
val path = if(isPullRequest){ "pull" }else{ "issues" }
}

View File

@@ -200,7 +200,7 @@ class JsonFormatSpec extends Specification {
"title": "Found a bug",
"body": "I'm having a problem with this.",
"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",
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z"