cannot graphql data you can't see
This commit is contained in:
@@ -69,7 +69,6 @@
|
||||
q)))
|
||||
|
||||
(defn base-graphql [{:keys [company-id vendor-id check-number bank-account-id status amount id]}]
|
||||
(println "ID" id)
|
||||
|
||||
(cond-> base-query
|
||||
(limited-companies id) (helpers/merge-where [:in :company-id (limited-companies id)])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
(ns auto-ap.db.invoices
|
||||
(:require [auto-ap.db.utils :refer [clj->db kebab->snake db->clj get-conn query] :as utils]
|
||||
(:require [auto-ap.db.utils :refer [clj->db kebab->snake db->clj get-conn query limited-companies] :as utils]
|
||||
[auto-ap.parse :as parse]
|
||||
[auto-ap.db.companies :as companies]
|
||||
[auto-ap.db.invoices-checks :as invoices-checks]
|
||||
@@ -108,8 +108,9 @@
|
||||
|
||||
|
||||
|
||||
(defn base-graphql [{:keys [imported company-id status]}]
|
||||
(defn base-graphql [{:keys [imported company-id status id]}]
|
||||
(cond-> base-query
|
||||
(limited-companies id) (helpers/merge-where [:in :company-id (limited-companies id)])
|
||||
(not (nil? imported)) (helpers/merge-where [:= :imported imported])
|
||||
(not (nil? status)) (helpers/merge-where [:= :status status])
|
||||
(not (nil? company-id)) (helpers/merge-where [:= :company-id company-id])))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
[honeysql.helpers :as helpers]
|
||||
[honeysql-postgres.format :as postgres-format]
|
||||
[honeysql-postgres.helpers :as postgres-helpers]
|
||||
[auto-ap.db.utils :refer [clj->db kebab->snake db->clj get-conn query] :as utils]))
|
||||
[auto-ap.db.utils :refer [clj->db kebab->snake db->clj get-conn query limited-companies] :as utils]))
|
||||
|
||||
(defn upsert! [row]
|
||||
(j/db-do-prepared (get-conn)
|
||||
@@ -16,8 +16,10 @@
|
||||
(def base-query (sql/build :select :*
|
||||
:from :transactions))
|
||||
|
||||
(defn base-graphql [{:keys [company-id]}]
|
||||
(defn base-graphql [{:keys [company-id id]}]
|
||||
(println "ID" id)
|
||||
(cond-> base-query
|
||||
(limited-companies id) (helpers/merge-where [:in :company-id (limited-companies id)])
|
||||
(not (nil? company-id)) (helpers/merge-where [:= :company-id company-id])))
|
||||
|
||||
(defn get-graphql [{:keys [start sort-by asc] :as args}]
|
||||
|
||||
Reference in New Issue
Block a user