diff --git a/dna/course/zomes/courses/code/src/lib.rs b/dna/course/zomes/courses/code/src/lib.rs
index 541ce29..430afc8 100644
--- a/dna/course/zomes/courses/code/src/lib.rs
+++ b/dna/course/zomes/courses/code/src/lib.rs
@@ -72,7 +72,7 @@ mod courses {
None => return Ok(None),
}
}
-
+ // sections_address - do I need to replicate this in the sections CRUD? Seems weird to update the course this way.
#[zome_fn("hc_public")]
fn update_course(
title: String,
@@ -102,11 +102,84 @@ mod courses {
course::handlers::get_my_enrolled_courses()
}
- // Section
+ // ====================== Section definitions
// TODO: implement section entry definitions
- // TODO: implement section CRUD methods
+ #[entry_def]
+ fn section_entry_definition() -> ValidatingEntryType {
+ course::entry::section_entry_def()
+ }
+
+ #[entry_def]
+ fn section_anchor_definition() -> ValidatingEntryType {
+ course::anchor::section_anchor_def()
+ }
+
+ // TODO: implement section CRUD methods --> fished out of modules "impl" right? or handlers?
+ #[zome_fn("hc_public")]
+ fn create_section(title: String, course_anchor_address: Address, timestamp: u64, anchor_address: Address,
+ ) -> ZomeApiResult
{
+ section::handlers::create(title, course_anchor_address, timestamp, anchor_address)
+ }
- // Content
+ #[zome_fn("hc_public")]
+ fn get_latest_section_entry(
+ section_anchor_address: Address,
+ ) -> ZomeApiResult