Improved code layout.
This commit is contained in:
parent
1f14ae5895
commit
6f7632c8ea
3 changed files with 6 additions and 6 deletions
|
@ -185,12 +185,12 @@ class FirstStepsController < ApplicationController
|
|||
raw: true,
|
||||
)
|
||||
UserInfo.current_user_id = customer.id
|
||||
ticket = Ticket.create(
|
||||
ticket = Ticket.create!(
|
||||
group_id: Group.find_by(active: true, name: 'Users').id,
|
||||
customer_id: customer.id,
|
||||
title: result[:subject],
|
||||
)
|
||||
article = Ticket::Article.create(
|
||||
article = Ticket::Article.create!(
|
||||
ticket_id: ticket.id,
|
||||
type_id: Ticket::Article::Type.find_by(name: 'phone').id,
|
||||
sender_id: Ticket::Article::Sender.find_by(name: 'Customer').id,
|
||||
|
|
|
@ -97,12 +97,12 @@ class FormController < ApplicationController
|
|||
# set current user
|
||||
UserInfo.current_user_id = customer.id
|
||||
|
||||
ticket = Ticket.create(
|
||||
ticket = Ticket.create!(
|
||||
group_id: 1,
|
||||
customer_id: customer.id,
|
||||
title: params[:title],
|
||||
)
|
||||
article = Ticket::Article.create(
|
||||
article = Ticket::Article.create!(
|
||||
ticket_id: ticket.id,
|
||||
type_id: Ticket::Article::Type.find_by(name: 'web').id,
|
||||
sender_id: Ticket::Article::Sender.find_by(name: 'Customer').id,
|
||||
|
|
|
@ -19,7 +19,7 @@ curl http://localhost/api/v1/recent_view -v -u #{login}:#{password} -H "Content-
|
|||
=end
|
||||
|
||||
def index
|
||||
recent_viewed = RecentView.list_full( current_user, 10 )
|
||||
recent_viewed = RecentView.list_full(current_user, 10)
|
||||
|
||||
# return result
|
||||
render json: recent_viewed
|
||||
|
@ -46,7 +46,7 @@ curl http://localhost/api/v1/recent_view -v -u #{login}:#{password} -H "Content-
|
|||
|
||||
def create
|
||||
|
||||
RecentView.log( params[:object], params[:o_id], current_user )
|
||||
RecentView.log(params[:object], params[:o_id], current_user)
|
||||
|
||||
# return result
|
||||
render json: { message: 'ok' }
|
||||
|
|
Loading…
Reference in a new issue