feat: add clear session messages functionality
- Implemented a new API endpoint to clear all messages in a session, enhancing session management capabilities. - Updated the frontend to include a clear messages option in the session menu, allowing users to easily remove chat history. - Added localization support for the new feature in English, Korean, Russian, and Chinese, improving accessibility for a broader audience. - Enhanced the chat view to handle session message clearing events, ensuring a responsive user experience. These changes significantly improve the user experience by providing a straightforward method to manage session messages effectively.
This commit is contained in:
@@ -245,6 +245,11 @@ func (r *messageRepository) UpdateMessageImages(ctx context.Context, sessionID,
|
||||
Update("images", images).Error
|
||||
}
|
||||
|
||||
// DeleteMessagesBySessionID deletes all messages belonging to a session (soft delete)
|
||||
func (r *messageRepository) DeleteMessagesBySessionID(ctx context.Context, sessionID string) error {
|
||||
return r.db.WithContext(ctx).Where("session_id = ?", sessionID).Delete(&types.Message{}).Error
|
||||
}
|
||||
|
||||
// UpdateMessageKnowledgeID updates the knowledge_id field for a message
|
||||
func (r *messageRepository) UpdateMessageKnowledgeID(
|
||||
ctx context.Context, messageID string, knowledgeID string,
|
||||
|
||||
Reference in New Issue
Block a user