From 934e81c5f9fa06fd1a9a6374c5c056fcf4c77799 Mon Sep 17 00:00:00 2001 From: Michel-Marie MAUDET Date: Sun, 14 Dec 2025 08:02:02 +0100 Subject: [PATCH] fix(api): Rename query parameter `id` to `message_id` for clarity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename the `id` query parameter to `message_id` in three message API endpoints for better API clarity and consistency: - GET /api/v1/message-content/:account_id - GET /api/v1/download-message/:account_id - GET /api/v1/download-attachment/:account_id This is a breaking change for API clients that use these endpoints. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 4.5 --- src/modules/rest/api/message.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/rest/api/message.rs b/src/modules/rest/api/message.rs index 5696e27..41ff759 100644 --- a/src/modules/rest/api/message.rs +++ b/src/modules/rest/api/message.rs @@ -135,12 +135,12 @@ impl MessageApi { async fn fetch_message_content( &self, account_id: Path, - id: Query, + message_id: Query, context: ClientContext, ) -> ApiResult> { let account_id = account_id.0; context.require_account_access(account_id)?; - Ok(Json(retrieve_email_content(account_id, id.0).await?)) + Ok(Json(retrieve_email_content(account_id, message_id.0).await?)) } /// Fetches the full content of a specific email for the given account. @@ -152,18 +152,18 @@ impl MessageApi { async fn download_message( &self, account_id: Path, - id: Query, + message_id: Query, context: ClientContext, ) -> ApiResult> { let account_id = account_id.0; AccountModel::check_account_exists(account_id).await?; context.require_account_access(account_id)?; - let id = id.0; - let reader = EML_INDEX_MANAGER.get_reader(account_id, id).await?; + let message_id = message_id.0; + let reader = EML_INDEX_MANAGER.get_reader(account_id, message_id).await?; let body = Body::from_async_read(reader); let attachment = Attachment::new(body) .attachment_type(AttachmentType::Attachment) - .filename(format!("{id}.eml")); + .filename(format!("{message_id}.eml")); Ok(attachment) } @@ -176,17 +176,17 @@ impl MessageApi { async fn download_attachment( &self, account_id: Path, - id: Query, + message_id: Query, name: Query, context: ClientContext, ) -> ApiResult> { let account_id = account_id.0; AccountModel::check_account_exists(account_id).await?; context.require_account_access(account_id)?; - let email_id = id.0; + let message_id = message_id.0; let name = name.0.trim(); let reader = EML_INDEX_MANAGER - .get_attachment(account_id, email_id, name) + .get_attachment(account_id, message_id, name) .await?; let body = Body::from_async_read(reader); let attachment = Attachment::new(body)