From 901fc7b5dcc0acf08b3e85d2160034ee47daedb2 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 5 Jul 2013 00:37:44 +0200 Subject: 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. --- scrumli.lisp | 5 +++-- static/js/main.js | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scrumli.lisp b/scrumli.lisp index 24c4469..26f99c5 100644 --- a/scrumli.lisp +++ b/scrumli.lisp @@ -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)) diff --git a/static/js/main.js b/static/js/main.js index 7aac80d..60988df 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -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', -- cgit v1.2.3-54-g00ecf