R/attach_resource_to_dataset.R

Defines functions attach_resource_to_dataset

Documented in attach_resource_to_dataset

#' attach_resource_to_dataset
#' link resources to dataset
#'
#' @param credentials list: object returned by the get_credentials() function
#' @param body json: json object generated by jsonlite::toJSON
#' @param root_url character: API root URL
#' @param dataset_nid character: Node ID of the dataset to be updated
#'
#' @return list
#' @export
#'

attach_resource_to_dataset <- function(credentials = list(cookie = dkanr::get_cookie(), token = dkanr::get_token()),
                                       body, root_url = dkanr::get_url(), dataset_nid) {

  ddhconnect::update_dataset(credentials = credentials,
                             nid = dataset_nid,
                             body = body,
                             root_url = root_url
                            )
}
tonyfujs/mdlibtoddh documentation built on March 14, 2021, 10 p.m.