Skip to content

Commit

Permalink
update comeln so that it matches the current version of the third par…
Browse files Browse the repository at this point in the history
…ty app resource public
  • Loading branch information
Konrad1991 committed Apr 23, 2024
1 parent a1f1e1d commit 2d3cdcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
6 changes: 1 addition & 5 deletions comeln/R/download.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ download <- function(session, folder) {

query <- getQueryString()
url <- paste0(ipaddress)
token <- query$token
response <- GET(paste0(
url,
"/api/v1/public_third_party_app/download?token=", token
))
response <- GET(url)
if(status_code(response)[[1]] != 200) {
showNotification("File could not be downloaded from ELN", duration = 0)
Sys.sleep(30)
Expand Down
10 changes: 4 additions & 6 deletions comeln/R/upload.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ upload <- function(session, filepath, new_name) {

query <- getQueryString()
url <- paste0(ipaddress)
token <- query$token

file_extension <- tools::file_ext(filepath)
request <- POST(paste0(
url,
"/api/v1/public_third_party_app/upload?token=", token),
body = list(file = upload_file(filepath), attachmentName = new_name,
fileType = file_extension))
request <- POST(
url,
body = list(file = upload_file(filepath), attachmentName = new_name,
fileType = file_extension) )
response <- content(request)
showNotification(response, duration = 0)
}

0 comments on commit 2d3cdcb

Please sign in to comment.