- def mark_message_as_read(%{assigns: %{user: %{id: user_id} = user}} = conn, %{
- id: chat_id,
- message_id: message_id
- }) do
- with %ChatMessageReference{} = cm_ref <-
- ChatMessageReference.get_by_id(message_id),
- ^chat_id <- cm_ref.chat_id |> to_string(),
+ def mark_message_as_read(
+ %{assigns: %{user: %{id: user_id}}} = conn,
+ %{id: chat_id, message_id: message_id}
+ ) do
+ with %MessageReference{} = cm_ref <- MessageReference.get_by_id(message_id),
+ ^chat_id <- to_string(cm_ref.chat_id),