Add SavedMessages channel type, add create DM.

This commit is contained in:
Paul Makles
2020-12-29 14:15:44 +00:00
parent eb382fa1ec
commit 84d09db9b3
7 changed files with 84 additions and 9 deletions

View File

@@ -26,13 +26,10 @@ pub async fn req(user: User) -> Result<JsonValue> {
.await
.map_err(|_| Error::DatabaseError { operation: "find", with: "channels" })?;
let mut channels: Vec<Channel> = vec![];
let mut channels = vec![];
while let Some(result) = cursor.next().await {
if let Ok(doc) = result {
channels.push(
from_bson(Bson::Document(doc))
.map_err(|_| Error::DatabaseError { operation: "from_bson", with: "channel" })?
);
channels.push(doc);
}
}