From 0cbf6d6aa1d9b5be00deccf8b83d434456264c84 Mon Sep 17 00:00:00 2001 From: ZhenYi <434836402@qq.com> Date: Fri, 17 Apr 2026 22:28:24 +0800 Subject: [PATCH] fix(room): accept comma-separated message_ids string in batch reaction endpoint --- libs/api/room/reaction.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/api/room/reaction.rs b/libs/api/room/reaction.rs index 8673a6e..caa3aab 100644 --- a/libs/api/room/reaction.rs +++ b/libs/api/room/reaction.rs @@ -20,7 +20,8 @@ pub struct MessageSearchQuery { #[derive(Debug, serde::Deserialize, IntoParams)] pub struct ReactionBatchQuery { - pub message_ids: Vec, + /// Comma-separated list of message IDs + pub message_ids: String, } #[utoipa::path( @@ -148,9 +149,14 @@ pub async fn reaction_batch( .user() .ok_or_else(|| ApiError::from(service::error::AppError::Unauthorized))?; let ctx = WsUserContext::new(user_id); + let message_ids: Vec = query + .message_ids + .split(',') + .filter_map(|s| Uuid::parse_str(s.trim()).ok()) + .collect(); let resp = service .room - .message_reactions_batch(room_id, query.into_inner().message_ids, &ctx) + .message_reactions_batch(room_id, message_ids, &ctx) .await .map_err(ApiError::from)?; Ok(ApiResponse::ok(resp).to_response())