Include group members in payload.

This commit is contained in:
Paul Makles
2021-01-26 22:05:32 +00:00
parent f42480886b
commit 3b85dcce14
15 changed files with 179 additions and 109 deletions

View File

@@ -54,16 +54,18 @@ impl Channel {
pub async fn get(id: &str) -> Result<Channel> {
let doc = get_collection("channels")
.find_one(
doc! { "_id": id },
None
)
.find_one(doc! { "_id": id }, None)
.await
.map_err(|_| Error::DatabaseError { operation: "find_one", with: "channel" })?
.map_err(|_| Error::DatabaseError {
operation: "find_one",
with: "channel",
})?
.ok_or_else(|| Error::UnknownChannel)?;
from_document::<Channel>(doc)
.map_err(|_| Error::DatabaseError { operation: "from_document", with: "channel" })
from_document::<Channel>(doc).map_err(|_| Error::DatabaseError {
operation: "from_document",
with: "channel",
})
}
pub async fn publish(self) -> Result<()> {