aboutsummaryrefslogtreecommitdiffstats
path: root/pg-datastore.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'pg-datastore.lisp')
-rw-r--r--pg-datastore.lisp12
1 files changed, 7 insertions, 5 deletions
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)