Skip to content

Commit

Permalink
simplify multipart body code
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac Davies committed Nov 12, 2024
1 parent 07345d7 commit 962faa4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
6 changes: 1 addition & 5 deletions R/dbfs.R
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,7 @@ db_dbfs_put <- function(path, file = NULL, contents = NULL, overwrite = FALSE,

if (perform_request) {
req |>
httr2::req_body_multipart(
path = body$path,
contents = body$contents,
overwrite = body$overwrite
) |>
httr2::req_body_multipart(!!!body) |>
httr2::req_error(body = db_req_error_body) |>
httr2::req_perform() |>
httr2::resp_body_json()
Expand Down
9 changes: 1 addition & 8 deletions R/workspaces.R
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,7 @@ db_workspace_import <- function(path,
token = token
)

req <- req |>
httr2::req_body_multipart(
path = body$path,
format = body$format,
overwrite = body$overwrite,
language = body$language,
content = body$content
)
req <- httr2::req_body_multipart(req, !!!body)

if (perform_request) {
db_perform_request(req)
Expand Down

0 comments on commit 962faa4

Please sign in to comment.