Skip to content

Commit

Permalink
Cleanup controller and view
Browse files Browse the repository at this point in the history
  • Loading branch information
mattlindsey committed Dec 8, 2024
1 parent 1756c64 commit af7bd12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
8 changes: 1 addition & 7 deletions app/controllers/messages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class MessagesController < ApplicationController

before_action :set_version, only: [:index, :update]
before_action :set_conversation, only: [:index]
before_action :set_query, only: [:index, :new]
before_action :set_assistant, only: [:index, :new, :edit, :create]
before_action :set_message, only: [:show, :edit, :update]
before_action :set_nav_conversations, only: [:index, :new]
Expand Down Expand Up @@ -73,10 +72,6 @@ def set_conversation
@conversation = Current.user.conversations.find(params[:conversation_id])
end

def set_query
@query = params[:query]
end

def set_assistant
@assistant = Current.user.assistants_including_deleted.find_by(slug: params[:assistant_id])
@assistant ||= @conversation.latest_message_for_version(@version).assistant
Expand All @@ -87,9 +82,8 @@ def set_message
redirect_to root_url, status: :unauthorized if @message.conversation.user != Current.user
end

# TODO: Can this taken out with the turbo-frame added?
def set_nav_conversations
@nav_conversations = Conversation.grouped_by_increasing_time_interval_for_user(Current.user, @query)
@nav_conversations = Conversation.grouped_by_increasing_time_interval_for_user(Current.user)
end

def set_nav_assistants
Expand Down
4 changes: 1 addition & 3 deletions app/views/conversations/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<turbo-frame id="conversations">
<%= render "nav_conversations" %>
</turbo-frame>
<%= render "nav_conversations" %>

0 comments on commit af7bd12

Please sign in to comment.