From dc20be9b9a4b527a156bb603dfd974991362f1c6 Mon Sep 17 00:00:00 2001 From: eblondel Date: Wed, 13 Mar 2024 23:35:21 +0100 Subject: [PATCH] fix #145 --- R/ZenodoRecord.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/ZenodoRecord.R b/R/ZenodoRecord.R index 7eaa8fa..fdc1db7 100644 --- a/R/ZenodoRecord.R +++ b/R/ZenodoRecord.R @@ -54,6 +54,12 @@ ZenodoRecord <- R6Class("ZenodoRecord", self$recid = obj$recid self$links = obj$links self$metadata = obj$metadata + resource_type = self$metadata$resource_type + if(!is.null(resource_type)){ + resource_type_id = resource_type$type + if(!is.null(resource_type$subtype)) resource_type_id = paste(resource_type_id, resource_type$subtype,sep="-") + self$metadata$resource_type = list(id = resource_type_id) + } self$modified = obj$modified self$owners = obj$owners self$status = obj$status @@ -242,7 +248,7 @@ ZenodoRecord <- R6Class("ZenodoRecord", self$ERROR(errorMsg) stop(errorMsg) } - self$metadata$resource_type <- zen_resourcetype + self$metadata$resource_type <- list(id = zen_resourcetype$id) }, #' @description Set the upload type (mandatory). Deprecated since zen4R 1.0