Update pivot.el
This commit is contained in:
parent
3dad71a9b7
commit
86f495e117
1 changed files with 10 additions and 5 deletions
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'json)
|
||||||
(require 'url)
|
(require 'url)
|
||||||
|
|
||||||
(defgroup pivotel nil
|
(defgroup pivotel nil
|
||||||
|
@ -98,15 +99,19 @@ Does not need a final `/'.")
|
||||||
"Get all stories for the current user."
|
"Get all stories for the current user."
|
||||||
(let ((project-ids (mapcar (lambda (itm) (cdr (assoc 'id itm)))
|
(let ((project-ids (mapcar (lambda (itm) (cdr (assoc 'id itm)))
|
||||||
(pivotel-get-projects))))
|
(pivotel-get-projects))))
|
||||||
(mapcar #'pivotel-get-stories project-ids)))
|
(apply #'append
|
||||||
|
(append (mapcar #'pivotel-get-stories project-ids) '(nil)))))
|
||||||
|
|
||||||
|
(defun pivotel--my-story-p (story)
|
||||||
|
"Check whether or not STORY belongs to the current user."
|
||||||
|
(memql (pivotel-get-me-id)
|
||||||
|
(append (cdr (assoc 'owner_ids story)) '(nil))))
|
||||||
|
|
||||||
(defun pivotel-get-my-owned-stories ()
|
(defun pivotel-get-my-owned-stories ()
|
||||||
"Get the stories for which the user is an owner."
|
"Get the stories for which the user is an owner."
|
||||||
(let ((stories (pivotel-get-all-stories))
|
(let ((stories (pivotel-get-all-stories)))
|
||||||
(id (pivotel-get-me-id)))
|
|
||||||
(delq nil
|
(delq nil
|
||||||
(mapcar (lambda (itm)
|
(mapcar (lambda (itm) (when (pivotel--my-story-p itm) itm))
|
||||||
(when (= (cdr (assoc 'owned_by_id itm)) id) itm))
|
|
||||||
stories))))
|
stories))))
|
||||||
|
|
||||||
(provide 'pivot)
|
(provide 'pivot)
|
||||||
|
|
Loading…
Reference in a new issue