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,6 @@
use crate::database::*;
use crate::util::result::{Error, Result, EmptyResponse};
use revolt_quark::{EmptyResponse, Result};
#[put("/<target>/ack")]
pub async fn req(user: User, target: Ref) -> Result<EmptyResponse> {
if user.bot.is_some() {
return Err(Error::IsBot)
}
let target = target.fetch_server().await?;
let perm = permissions::PermissionCalculator::new(&user)
.with_server(&target)
.for_server()
.await?;
if !perm.get_view() {
Err(Error::MissingPermission)?
}
target.mark_as_read(&user.id).await?;
Ok(EmptyResponse {})
pub async fn req(/*user: UserRef, target: Ref*/ target: String) -> Result<EmptyResponse> {
todo!()
}