1
0
Fork 0
forked from gorb/backend

style: cargo clippy && format

This commit is contained in:
Radical 2025-05-24 01:09:17 +02:00
parent 860fa7a66e
commit 8605b81e7b
26 changed files with 274 additions and 178 deletions

View file

@ -3,9 +3,9 @@ use actix_web::{HttpRequest, HttpResponse, get, post, web};
use serde::Deserialize;
use crate::{
error::Error,
Data,
api::v1::auth::check_access_token,
error::Error,
structs::{Member, Role},
utils::get_auth_header,
};
@ -43,8 +43,7 @@ pub async fn get(
let roles = Role::fetch_all(&mut conn, guild_uuid).await?;
data
.set_cache_key(format!("{}_roles", guild_uuid), roles.clone(), 1800)
data.set_cache_key(format!("{}_roles", guild_uuid), roles.clone(), 1800)
.await?;
Ok(HttpResponse::Ok().json(roles))

View file

@ -1,7 +1,7 @@
use crate::{
error::Error,
Data,
api::v1::auth::check_access_token,
error::Error,
structs::{Member, Role},
utils::get_auth_header,
};
@ -34,8 +34,7 @@ pub async fn get(
let role = Role::fetch_one(&mut conn, role_uuid).await?;
data
.set_cache_key(format!("{}", role_uuid), role.clone(), 60)
data.set_cache_key(format!("{}", role_uuid), role.clone(), 60)
.await?;
Ok(HttpResponse::Ok().json(role))