db_actions_list <- function(db, colony_id) { api_get(db, "/v1/actions", list(colony_id = colony_id)) } db_actions_get <- function(db, id) { api_get_one(db, paste0("/v1/actions/", id)) } db_actions_insert <- function(db, colony_id, date, type, notes = NA, time = NA, related_colony_id = NA) { result <- api_post(db, "/v1/actions", list( colony_id = colony_id, date = as.character(date), type = type, notes = notes, time = time, related_colony_id = related_colony_id )) result$id } db_actions_update <- function(db, id, date, type, notes = NA) { api_put(db, paste0("/v1/actions/", id), list( date = as.character(date), type = type, notes = notes )) } db_actions_delete <- function(db, id) { api_delete(db, paste0("/v1/actions/", id)) }