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())