feat: migrate v1 api mod to use actix_auth_middleware

This commit is contained in:
realaravinth
2022-05-07 12:29:37 +05:30
parent b057e48d72
commit a668fafa62
17 changed files with 65 additions and 19 deletions

View File

@@ -32,7 +32,7 @@ pub struct AddNotification {
/// route handler that adds a notification message
#[my_codegen::post(
path = "crate::V1_API_ROUTES.notifications.add",
wrap = "crate::CheckLogin"
wrap = "crate::api::v1::get_middleware()"
)]
pub async fn add_notification(
payload: web::Json<AddNotification>,

View File

@@ -55,7 +55,7 @@ impl From<Notification> for NotificationResp {
/// route handler that gets all unread notifications
#[my_codegen::get(
path = "crate::V1_API_ROUTES.notifications.get",
wrap = "crate::CheckLogin"
wrap = "crate::api::v1::get_middleware()"
)]
pub async fn get_notification(
data: AppData,

View File

@@ -39,7 +39,7 @@ pub struct NotificationResp {
/// route handler that marks a notification read
#[my_codegen::post(
path = "crate::V1_API_ROUTES.notifications.mark_read",
wrap = "crate::CheckLogin"
wrap = "crate::api::v1::get_middleware()"
)]
pub async fn mark_read(
data: AppData,