[][src]Function hdk::api::remove_link

pub fn remove_link<S: Into<String>>(
    base: &Address,
    target: &Address,
    tag: S
) -> Result<(), ZomeApiError>

Consumes three values, two of which are the addresses of entries, and one of which is a string that removes a relationship between them, called a tag. Later, lists of entries.

Examples

#[derive(Serialize, Deserialize, Debug, DefaultJson)]
pub struct Post {
    content: String,
    date_created: String,
}

pub fn handle_remove_link(content: String, in_reply_to: Option<Address>) -> ZomeApiResult<()> {

    let post_entry = Entry::App("post".into(), Post{
            content,
            date_created: "now".into(),
    }.into());

    let address = hdk::commit_entry(&post_entry)?;

    hdk::remove_link(
        &AGENT_ADDRESS,
        &address,
        "authored_posts",
    )?;


    Ok(())

}