Improved error handling of ticket creation.
This commit is contained in:
parent
abb7db9323
commit
879ba366ab
2 changed files with 7 additions and 2 deletions
|
@ -87,12 +87,13 @@ class Index extends App.Controller
|
||||||
# find sender_id
|
# find sender_id
|
||||||
sender = App.TicketArticleSender.findByAttribute("name", "Customer")
|
sender = App.TicketArticleSender.findByAttribute("name", "Customer")
|
||||||
type = App.TicketArticleType.findByAttribute("name", "phone")
|
type = App.TicketArticleType.findByAttribute("name", "phone")
|
||||||
|
if params.group_id
|
||||||
group = App.Group.find(params.group_id)
|
group = App.Group.find(params.group_id)
|
||||||
|
|
||||||
# create article
|
# create article
|
||||||
params['article'] = {
|
params['article'] = {
|
||||||
from: params.customer_id_autocompletion,
|
from: params.customer_id_autocompletion,
|
||||||
to: group.name,
|
to: (group && group.name) || '',
|
||||||
subject: params.subject,
|
subject: params.subject,
|
||||||
body: params.body,
|
body: params.body,
|
||||||
ticket_article_type_id: type.id,
|
ticket_article_type_id: type.id,
|
||||||
|
@ -128,6 +129,9 @@ class Index extends App.Controller
|
||||||
# create new create screen
|
# create new create screen
|
||||||
@render()
|
@render()
|
||||||
|
|
||||||
|
# scroll to top
|
||||||
|
window.scrollTo(0,0)
|
||||||
|
|
||||||
error: =>
|
error: =>
|
||||||
@log 'save failed!'
|
@log 'save failed!'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
class TicketsController < ApplicationController
|
class TicketsController < ApplicationController
|
||||||
|
skip_before_filter :verify_authenticity_token
|
||||||
before_filter :authentication_check
|
before_filter :authentication_check
|
||||||
|
|
||||||
# GET /tickets
|
# GET /tickets
|
||||||
|
|
Loading…
Reference in a new issue