db_apiaries_list <- function(db) { api_get(db, "/v1/apiaries") } db_apiaries_get <- function(db, id) { api_get_one(db, paste0("/v1/apiaries/", id)) } db_apiaries_insert <- function(db, name, location_text = NA, lat = NA, lng = NA, notes = NA) { result <- api_post(db, "/v1/apiaries", list( name = name, location_text = location_text, lat = lat, lng = lng, notes = notes )) result$id } db_apiaries_update <- function(db, id, name, location_text = NA, lat = NA, lng = NA, notes = NA) { api_put(db, paste0("/v1/apiaries/", id), list( name = name, location_text = location_text, lat = lat, lng = lng, notes = notes )) } db_apiaries_delete <- function(db, id) { api_delete(db, paste0("/v1/apiaries/", id)) }