From 84ae7a5fd4524cc06def467efd62019d810781f4 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 13 Jul 2013 21:09:40 +0200 Subject: Handle task interaction like story interaction When moving or adding tasks, instead of waiting for the user to reselect the task reload the task each time. --- pg-datastore.lisp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'pg-datastore.lisp') diff --git a/pg-datastore.lisp b/pg-datastore.lisp index 0952ab0..805e748 100644 --- a/pg-datastore.lisp +++ b/pg-datastore.lisp @@ -46,11 +46,13 @@ (defmethod datastore-get-story ((datastore pg-datastore) id) (with-connection (connection-spec datastore) (append (query (:select :* :from 'story :where (:= 'id id)) :alist) - `((tasks . ,(query (:order-by - (:select :* :from 'task - :where (:= 'story-id id)) - 'priority) - :alists)))))) + `((tasks . ,(datastore-get-tasks-for-story datastore id)))))) + +(defmethod datastore-get-tasks-for-story ((datastore pg-datastore) id) + (with-connection (connection-spec datastore) + (query (:order-by (:select :* :from 'task :where (:= 'story-id id)) + 'priority) + :alists))) (defmethod datastore-post-story ((datastore pg-datastore) role necessity title content reporter) -- cgit v1.2.3-54-g00ecf