lib/tracker_api/endpoints/comment.rb in tracker_api-1.7.1 vs lib/tracker_api/endpoints/comment.rb in tracker_api-1.8.0
- old
+ new
@@ -13,15 +13,22 @@
end
def update(comment, params={})
raise ArgumentError, 'Valid comment required to update.' unless comment.instance_of?(Resources::Comment)
- data = client.put("/projects/#{comment.project_id}/stories/#{comment.story_id}/comments/#{comment.id}",
- params: params).body
+ path = "/projects/#{comment.project_id}/stories/#{comment.story_id}/comments/#{comment.id}"
+ path += "?fields=:default,file_attachments" if params.represented.file_attachment_ids_to_add.present? || params.represented.file_attachment_ids_to_remove.present?
+ data = client.put(path, params: params).body
comment.attributes = data
comment.clean!
comment
+ end
+
+ def delete(comment)
+ raise ArgumentError, 'Valid comment required to update.' unless comment.instance_of?(Resources::Comment)
+
+ client.delete("/projects/#{comment.project_id}/stories/#{comment.story_id}/comments/#{comment.id}").body
end
end
end
end