chore(thanos): strip down codebase to just API routes

This commit is contained in:
Paul Makles
2022-01-27 14:16:30 +00:00
parent ab4c3f913e
commit 0fdb749199
116 changed files with 893 additions and 10025 deletions

View File

@@ -1,23 +1,8 @@
use crate::database::*;
use crate::util::result::{Error, Result};
use revolt_quark::Result;
use rocket::serde::json::Value;
#[get("/<target>/members")]
pub async fn req(user: User, target: Ref) -> Result<Value> {
let target = target.fetch_channel().await?;
let perm = permissions::PermissionCalculator::new(&user)
.with_channel(&target)
.for_channel()
.await?;
if !perm.get_view() {
Err(Error::MissingPermission)?
}
if let Channel::Group { recipients, .. } = target {
Ok(json!(user.fetch_multiple_users(&recipients).await?))
} else {
Err(Error::InvalidOperation)
}
pub async fn req(/*user: UserRef, target: Ref*/ target: String) -> Result<Value> {
todo!()
}