Pass story id as POST parameter

For some reason using a route template "stories/:id/tasks/new" works
locally, but not on my server, so do without.
This commit is contained in:
Tom Willemse 2013-07-05 00:37:44 +02:00
parent 74ec275c8f
commit 901fc7b5dc
2 changed files with 6 additions and 3 deletions

View file

@ -80,9 +80,10 @@
200)
403))
(define-route tasks-new ("stories/:id/tasks/new" :method :post)
(define-route tasks-new ("stories/tasks/new" :method :post)
(if (logged-in-p)
(let ((description (hunchentoot:post-parameter "description")))
(let ((id (hunchentoot:post-parameter "storyId"))
(description (hunchentoot:post-parameter "description")))
(post-task id description (hunchentoot:session-value :username))
200)
403))

View file

@ -103,8 +103,10 @@ var StoryTaskForm = React.createClass({
var StoryData = React.createClass({
handleTaskSubmit: React.autoBind(function (task) {
task.storyId = this.props.data.id;
$.ajax({
url: "/stories/" + this.props.data.id + "/tasks/new",
url: "/stories/tasks/new",
type: "POST",
data: task,
dataType: 'json',