refactor(api): reorder imports and update code formatting across repository endpoints
- Reordered actix-web imports to standardize import order - Reordered crate module imports to follow alphabetical ordering - Updated function calls to use multi-line formatting for better readability - Standardized blank lines around documentation comments - Applied consistent formatting to response handling methods - Normalized import organization across all repository-related API files - Improved code consistency and maintainability through standardized formatting - Applied formatting updates to all repository endpoint implementations
This commit is contained in:
+14
-7
@@ -1,12 +1,12 @@
|
||||
use actix_web::{web, HttpResponse};
|
||||
use actix_web::{HttpResponse, web};
|
||||
use serde::Deserialize;
|
||||
use utoipa::IntoParams;
|
||||
|
||||
use crate::api::response::{ApiResponse, ApiErrorResponse};
|
||||
use crate::api::response::{ApiErrorResponse, ApiResponse};
|
||||
use crate::error::AppError;
|
||||
use crate::service::AppService;
|
||||
use crate::session::Session;
|
||||
use crate::service::repo::watches::WatchParams;
|
||||
use crate::session::Session;
|
||||
|
||||
#[derive(Debug, Deserialize, IntoParams)]
|
||||
pub struct PathParams {
|
||||
@@ -20,12 +20,12 @@ pub struct PathParams {
|
||||
///
|
||||
/// Subscribes the current user to notifications for repository activities.
|
||||
/// Requires read access to the repository.
|
||||
///
|
||||
///
|
||||
/// Watch levels:
|
||||
/// - "participating": Notifications for issues/PRs you're involved in
|
||||
/// - "watching": All repository notifications (default)
|
||||
/// - "ignoring": No notifications
|
||||
///
|
||||
///
|
||||
/// Returns success message on completion. Idempotent operation.
|
||||
#[utoipa::path(
|
||||
post,
|
||||
@@ -58,8 +58,15 @@ pub async fn watch_repo(
|
||||
) -> Result<HttpResponse, AppError> {
|
||||
service
|
||||
.repo
|
||||
.repo_watch(&session, &path.workspace_name, &path.repo_name, params.into_inner())
|
||||
.repo_watch(
|
||||
&session,
|
||||
&path.workspace_name,
|
||||
&path.repo_name,
|
||||
params.into_inner(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(HttpResponse::Ok().json(ApiResponse::new("Repository watch subscription updated successfully".to_string())))
|
||||
Ok(HttpResponse::Ok().json(ApiResponse::new(
|
||||
"Repository watch subscription updated successfully".to_string(),
|
||||
)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user