Skip to content

Commit

Permalink
PutCommentsRequest accepts vec
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-prosser committed Jul 25, 2024
1 parent 671601c commit 617ade7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 2 additions & 4 deletions api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,15 +490,13 @@ impl Client {
pub fn put_comments_split_on_failure(
&self,
source_name: &SourceFullName,
comments: &[NewComment],
comments: Vec<NewComment>,
no_charge: bool,
) -> Result<SplitableRequestResponse<PutCommentsResponse>> {
self.splitable_request(
Method::PUT,
self.endpoints.put_comments(source_name)?,
PutCommentsRequest {
comments: comments.to_vec(),
},
PutCommentsRequest { comments },
Some(NoChargeQuery { no_charge }),
Retry::No,
)
Expand Down
6 changes: 5 additions & 1 deletion cli/src/commands/create/comments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,11 @@ fn upload_batch_of_comments(
if !comments_to_put.is_empty() {
if resume_on_error {
let result = client
.put_comments_split_on_failure(&source.full_name(), comments_to_put, no_charge)
.put_comments_split_on_failure(
&source.full_name(),
comments_to_put.to_vec(),
no_charge,
)
.context("Could not put batch of comments")?;
failed += result.num_failed;
} else {
Expand Down

0 comments on commit 617ade7

Please sign in to comment.