From 9188fa6e13ea7facfab5fb6f55bf26444ec2c01e Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Nov 2026 03:15:05 +0000 Subject: document: values read and written through a view any kind of document gives document::view: Read (the value at a path, plain, typed, a map's keys) and Write (a value written, one deleted), which Automerge's documents, writes in progress and documents as they were all are. The member registry, the users, access control's reads and rules, the topology, forgetting and bootstrap read and write through them, and name neither Automerge's ReadDoc and Transactable nor document::store, which is what an Automerge document can do beyond. How a swarm holding a store judges what a change writes is handed to the rules (rules::judge_seen), being its kind of document's to say. --- src/api/login.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/api/login.rs') diff --git a/src/api/login.rs b/src/api/login.rs index ffcf9b8..02c54a3 100644 --- a/src/api/login.rs +++ b/src/api/login.rs @@ -678,7 +678,7 @@ async fn end(state: &AppState, claims: &Claims, by: &str) -> Result<(), ApiError if !registry::exists(&*doc) { return Ok::<_, ApiError>(false); } - crate::document::store::write_path(doc, &path, &json!(until))?; + crate::document::view::write_path(doc, &path, &json!(until))?; Ok(true) }) .await? @@ -783,10 +783,10 @@ pub(crate) async fn revoke_tokens(state: &AppState, name: &str, by: &str) -> Res ), )); } - if crate::document::store::read_path(&*doc, &entry)?.is_none() { + if crate::document::view::read_path(&*doc, &entry)?.is_none() { return Err(ApiError(StatusCode::NOT_FOUND, None)); } - crate::document::store::write_path(doc, &logouts, &json!(after))?; + crate::document::view::write_path(doc, &logouts, &json!(after))?; Ok(()) }) .await?; -- cgit v1.3.1