mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-17 11:53:40 +08:00
14 lines
422 B
CoffeeScript
14 lines
422 B
CoffeeScript
$ ->
|
|
$('.action-create').click ->
|
|
$.post '/ticket/create/', JSON.stringify
|
|
type: $('#type').val()
|
|
title: $('#title').val()
|
|
content: $('#content').val()
|
|
.fail (jqXHR) ->
|
|
if jqXHR.responseJSON?.error
|
|
alert jqXHR.responseJSON.error
|
|
else
|
|
alert jqXHR.statusText
|
|
.success (data, text_status, jqXHR) ->
|
|
location.href = "/ticket/view/?id=#{jqXHR.responseJSON.id}"
|