added get history on the frontend
This commit is contained in:
1 parent
7c9ec914b1
commit
0ca1da5018
7 files changed
+109
-9
No files matched your search
@@ -101,7 +101,7 @@ class AsksController < ApplicationController
|
||||
end
|
||||
end
|
||||
end
|
||||
[category_id,
|
||||
[category_id,
|
||||
{
|
||||
setting: ask_setting,
|
||||
custom_fields: custom_fields.to_h
|
||||
@@ -285,6 +285,7 @@ class AsksController < ApplicationController
|
||||
'switch_form' => switch_form,
|
||||
'ask_setting' => ask_setting,
|
||||
'default_ask_setting' => @default_ask_setting,
|
||||
'question_status' => @params['type'],
|
||||
'email_regex' => email_regex
|
||||
}
|
||||
elsif @layout_type == 'published_index'
|
||||
@@ -335,7 +336,7 @@ class AsksController < ApplicationController
|
||||
end
|
||||
end
|
||||
end
|
||||
[category_id,
|
||||
[category_id,
|
||||
{
|
||||
setting: ask_setting,
|
||||
custom_fields: custom_fields.to_h
|
||||
@@ -444,7 +445,7 @@ class AsksController < ApplicationController
|
||||
if !file.blank?
|
||||
if v['type']=='image'
|
||||
all_to_save += [[k,AskImage.new(file: file,ask_question_id: @ask_question.id)]]
|
||||
else
|
||||
else
|
||||
all_to_save += [[k,AskFile.new(file: file,ask_question_id: @ask_question.id)]]
|
||||
end
|
||||
end
|
||||
@@ -594,6 +595,7 @@ class AsksController < ApplicationController
|
||||
"identity" => email_er[:identity],
|
||||
"mail" => email_er.mail,
|
||||
"phone" => email_er.phone,
|
||||
"serial_number" => email_er.get_serial_number,
|
||||
# "fax" => email_er.fax,
|
||||
# "content" => email_er.content
|
||||
"appointment" => email_er.appointment,
|
||||
@@ -619,6 +621,7 @@ class AsksController < ApplicationController
|
||||
"identity" => email_er[:identity],
|
||||
"mail" => email_er.mail,
|
||||
"phone" => email_er.phone,
|
||||
"serial_number" => email_er.get_serial_number,
|
||||
# "fax" => email_er.fax,
|
||||
# "content" => email_er.content
|
||||
"appointment" => email_er.appointment,
|
||||
@@ -633,6 +636,17 @@ class AsksController < ApplicationController
|
||||
# email_er.email.deliver
|
||||
end
|
||||
|
||||
def get_history
|
||||
question = AskQuestion.where(:serial_number => params["ticket_id"].to_i, :mail => params["email"]).first
|
||||
if !question.nil?
|
||||
@histories = question.ask_status_histories
|
||||
@status_mapping = AskTicketStatus.default_sorting.map{|a| [a.key, a.title]}.to_h
|
||||
else
|
||||
@histories = []
|
||||
end
|
||||
render :partial => "history"
|
||||
end
|
||||
|
||||
def create_params
|
||||
params.require(:ask_question).permit!
|
||||
end
|
||||
@@ -896,4 +910,4 @@ class AsksController < ApplicationController
|
||||
end.join
|
||||
switch_form
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user