refactor(server): remove sort by size in pg_acl_engine.rs (dead code)

This commit is contained in:
Edouard Vanbelle
2026-05-29 13:10:13 +02:00
parent b782a59766
commit 3f70c7e20a
4 changed files with 11 additions and 52 deletions
@@ -56,7 +56,9 @@ pub async fn get_favorites(
auth_user: AuthUser,
) -> impl IntoResponse {
let user_id = auth_user.id;
warn!("Deprecated endpoint called: GET /api/favorites — use GET /api/favorites/resources instead");
warn!(
"Deprecated endpoint called: GET /api/favorites — use GET /api/favorites/resources instead"
);
match favorites_service.get_favorites(user_id).await {
Ok(favorites) => {
@@ -490,7 +490,9 @@ pub async fn list_folder_contents(
auth_user: AuthUser,
path: Path<String>,
) -> axum::response::Response {
tracing::warn!("Deprecated endpoint called: GET /api/folders/{{id}}/contents — use GET /api/folders/{{id}}/resources?resource_types=folder instead");
tracing::warn!(
"Deprecated endpoint called: GET /api/folders/{{id}}/contents — use GET /api/folders/{{id}}/resources?resource_types=folder instead"
);
FolderHandler::list_folder_contents_impl(state, auth_user, path).await
}
@@ -534,7 +536,9 @@ pub async fn list_folder_contents_paginated(
path: Path<String>,
pagination: Query<PaginationRequestDto>,
) -> axum::response::Response {
tracing::warn!("Deprecated endpoint called: GET /api/folders/{{id}}/contents/paginated — use GET /api/folders/{{id}}/resources instead");
tracing::warn!(
"Deprecated endpoint called: GET /api/folders/{{id}}/contents/paginated — use GET /api/folders/{{id}}/resources instead"
);
FolderHandler::list_folder_contents_paginated_impl(state, auth_user, path, pagination).await
}
+2 -5
View File
@@ -351,13 +351,10 @@ pub async fn list_shared_with_me(
// Validate sort_by (defaults to "granted_at").
let sort_by = q.sort_by.as_deref().unwrap_or("granted_at");
if !matches!(
sort_by,
"granted_at" | "granted_by" | "name" | "type" | "size"
) {
if !matches!(sort_by, "granted_at" | "granted_by" | "name" | "type") {
return (
StatusCode::BAD_REQUEST,
Json(serde_json::json!({"error": "invalid sort_by; valid values: granted_at, granted_by, name, type, size"})),
Json(serde_json::json!({"error": "invalid sort_by; valid values: granted_at, granted_by, name, type"})),
)
.into_response();
}