From 9c4a9cb1fb077670db048250c902031a9cda9210 Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <thomasfkjorna@gmail.com>
Date: Sat, 24 Jul 2021 19:49:59 +0200
Subject: added filter and orphan toggle

---
 org-roam-ui.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'org-roam-ui.el')

diff --git a/org-roam-ui.el b/org-roam-ui.el
index 560315b..d823e77 100644
--- a/org-roam-ui.el
+++ b/org-roam-ui.el
@@ -78,11 +78,11 @@ This serves the web-build and API over HTTP."
 
 (defservlet* graph application/json ()
   (let* ((nodes-columns [id file title level])
-         (links-columns [source dest])
+         (links-columns [source dest type])
          (nodes-db-rows (org-roam-db-query `[:select ,nodes-columns :from nodes]))
-         (links-db-rows (org-roam-db-query `[:select ,links-columns :from links :where (= type "id")]))
+         (links-db-rows (org-roam-db-query `[:select ,links-columns :from links :where (or (= type "id") (= type "cite"))]))
          (response (json-encode `((nodes . ,(mapcar (apply-partially #'org-roam-ui-sql-to-alist (append nodes-columns nil)) nodes-db-rows))
-                                  (links . ,(mapcar (apply-partially #'org-roam-ui-sql-to-alist '(source target)) links-db-rows))))))
+                                  (links . ,(mapcar (apply-partially #'org-roam-ui-sql-to-alist '(source target type)) links-db-rows))))))
     (insert response)
     (httpd-send-header t "application/json" 200 :Access-Control-Allow-Origin "*")))
 
-- 
cgit v1.2.3