mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-03-29 22:20:30 +08:00
21 lines
464 B
CoffeeScript
21 lines
464 B
CoffeeScript
$ ->
|
|
$('#create-ticket').on 'click', (e) ->
|
|
e.preventDefault()
|
|
data = {
|
|
type: $('#type').val()
|
|
title: $('#title').val()
|
|
content: $('#ticket-content').val()
|
|
}
|
|
|
|
$.ajax {
|
|
method: 'post'
|
|
url: '/ticket/create/'
|
|
data: data
|
|
}
|
|
.done (reply) ->
|
|
location.href = '/ticket/list/'
|
|
.fail (reply) ->
|
|
if reply.status is 400
|
|
error = reply.responseJSON.error
|
|
ErrorHandle.flushError error
|