fix pull comments

This commit is contained in:
Alexander Machehin 2015-03-20 00:52:14 +05:00
parent 0911103ea1
commit 0b9795fabd
1 changed files with 11 additions and 8 deletions

View File

@ -1,12 +1,15 @@
commentService = ($http) -> commentService = ($http) ->
getPath = (kind, project, commentable, id) -> getPath = (kind, project, commentable, id) ->
if (kind is 'remove' or kind is 'update') and commentable.kind is 'issue' if commentable.kind is 'issue' or commentable.kind is 'pull'
if kind is 'remove' or kind is 'update'
return Routes.project_issue_comment_path(project, commentable.id, id) return Routes.project_issue_comment_path(project, commentable.id, id)
else if kind is 'add' and commentable.kind is 'issue' else if kind is 'add'
return Routes.project_issue_comments_path(project, commentable.id) return Routes.project_issue_comments_path(project, commentable.id)
else if (kind is 'remove' or kind is 'update') and commentable.kind is 'commit'
else if commentable.kind is 'commit'
if kind is 'remove' or kind is 'update'
return Routes.project_commit_comment_path(project, commentable.id, id) return Routes.project_commit_comment_path(project, commentable.id, id)
else if kind is 'add' and commentable.kind is 'commit' else if kind is 'add'
return Routes.project_commit_comments_path(project, commentable.id) return Routes.project_commit_comments_path(project, commentable.id)
{ {