From 51297f2dee0a1483101fec933f0a56ab1dc62043 Mon Sep 17 00:00:00 2001 From: afwillia Date: Tue, 30 Jul 2024 13:29:39 -0700 Subject: [PATCH 1/2] when checking for certified users, use the certified attribute, not passed --- R/synapse_rest_api.R | 3 ++- functions/synapse_rest_api.R | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/R/synapse_rest_api.R b/R/synapse_rest_api.R index ea390b94..3d3cedaa 100644 --- a/R/synapse_rest_api.R +++ b/R/synapse_rest_api.R @@ -38,7 +38,8 @@ synapse_is_certified <- function(url="https://repo-prod.prod.sagebase.org/repo/v ownerid <- user_profile[["ownerId"]] url_req <- file.path(url, ownerid, endpoint) req <- httr::GET(url_req) - httr::content(req)[["passed"]] + resp <- httr::content(req) + resp[["certified"]] } diff --git a/functions/synapse_rest_api.R b/functions/synapse_rest_api.R index ea390b94..3d3cedaa 100644 --- a/functions/synapse_rest_api.R +++ b/functions/synapse_rest_api.R @@ -38,7 +38,8 @@ synapse_is_certified <- function(url="https://repo-prod.prod.sagebase.org/repo/v ownerid <- user_profile[["ownerId"]] url_req <- file.path(url, ownerid, endpoint) req <- httr::GET(url_req) - httr::content(req)[["passed"]] + resp <- httr::content(req) + resp[["certified"]] } From 3be5aac0765ac5f0740862650ca3bb63e5811bed Mon Sep 17 00:00:00 2001 From: afwillia Date: Tue, 30 Jul 2024 14:14:22 -0700 Subject: [PATCH 2/2] check response for certified attribute, otherwise return false --- R/synapse_rest_api.R | 4 +++- functions/synapse_rest_api.R | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/R/synapse_rest_api.R b/R/synapse_rest_api.R index 3d3cedaa..94cac87f 100644 --- a/R/synapse_rest_api.R +++ b/R/synapse_rest_api.R @@ -39,7 +39,9 @@ synapse_is_certified <- function(url="https://repo-prod.prod.sagebase.org/repo/v url_req <- file.path(url, ownerid, endpoint) req <- httr::GET(url_req) resp <- httr::content(req) - resp[["certified"]] + if ("certified" %in% names(resp)) { + return(resp[["certified"]]) + } else return(FALSE) } diff --git a/functions/synapse_rest_api.R b/functions/synapse_rest_api.R index 3d3cedaa..94cac87f 100644 --- a/functions/synapse_rest_api.R +++ b/functions/synapse_rest_api.R @@ -39,7 +39,9 @@ synapse_is_certified <- function(url="https://repo-prod.prod.sagebase.org/repo/v url_req <- file.path(url, ownerid, endpoint) req <- httr::GET(url_req) resp <- httr::content(req) - resp[["certified"]] + if ("certified" %in% names(resp)) { + return(resp[["certified"]]) + } else return(FALSE) }