Skip to main content

insert

pub async fn insert(
    conn: &mut PgConnection,
    input: ChatbotConversationMessage,
) -> ModelResult<ChatbotConversationMessage>
Expand description

Appends a message to a conversation, allocating the next order_number for it.

Inserts both the message row and the row of the inner message type carried by input.message; input.id and input.order_number are ignored and assigned by the database. Errors if the conversation does not exist or has been deleted.