feat(claw): list account watches beside repo watches on the surface
A saved account whose forge notifications are not actually followed was invisible: the save's watch flag defaults to false on the tool and the HTTP route, and GET /v1/watches listed only the repo-watch table. The first question a silent forge thread raises — is my account even subscribed? — was unanswerable from outside. The route now answers it.
This commit is contained in:
1 parent
04549a7df5
commit
7c707e7a09
1 file changed
+12
-1
@@ -534,7 +534,18 @@ async fn watches_list(State(state): State<ClawState>) -> Result<Json<Value>, (St
|
|||||||
.watches
|
.watches
|
||||||
.list()
|
.list()
|
||||||
.map_err(|err| (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()))?;
|
.map_err(|err| (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()))?;
|
||||||
Ok(Json(json!({ "watches": watches })))
|
// The account watches ride along: a saved account whose forge
|
||||||
|
// notifications are not actually being followed is invisible
|
||||||
|
// otherwise — the save's `watch` flag defaults to false on both the
|
||||||
|
// tool and this surface, and "is my account subscribed?" is the
|
||||||
|
// first question a silent forge thread raises.
|
||||||
|
let account_watches = state
|
||||||
|
.watches
|
||||||
|
.list_account_watches()
|
||||||
|
.map_err(|err| (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()))?;
|
||||||
|
Ok(Json(
|
||||||
|
json!({ "watches": watches, "account_watches": account_watches }),
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `{"forge", "repo", "host"?, "token"?}` — the shape every watch entry
|
/// `{"forge", "repo", "host"?, "token"?}` — the shape every watch entry
|
||||||
|
|||||||
Reference in new issue
Block a user