Skip to content

Commit

Permalink
Add cu_token arg to attachments #19
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Solymos <psolymos@gmail.com>
  • Loading branch information
psolymos committed Jan 31, 2024
1 parent 52e6ae6 commit 80e4b52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/api-attachments.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@
## --form 'attachment=@/path/to/the/file/example.png'

## ... can be used to pass type argument to httr::upload_file
cu_post_task_attachment <- function(task_id, attachment, filename=NULL, ...) {
cu_post_task_attachment <- function(task_id, attachment, filename=NULL, ..., cu_token = NULL) {
task_id <- cu_task_id(task_id)
if (is.null(filename))
filename <- basename(attachment)
resp <- httr::POST(
httr::modify_url(getOption("cu_options")$baseurl,
path = .cu_path("task", task_id, "attachment")),
httr::add_headers(
Authorization = cu_get_pat(),
Authorization = cu_get_pat(token = cu_token),
"Content-Type" = "multipart/form-data"),
httr::accept_json(),
body=list(
Expand Down

0 comments on commit 80e4b52

Please sign in to comment.