mirror of
https://github.com/penpot/penpot.git
synced 2026-05-10 02:28:16 +00:00
🐛 Fix unexpected exception on searching without term.
When term is empty on frontend, frontend just does not sends it to backend, leving it as missing field. This commit makes the seatch-term as optional.
This commit is contained in:
parent
b861e261ed
commit
7819757759
@ -112,14 +112,16 @@
|
||||
order by f.created_at asc")
|
||||
|
||||
(s/def ::search-files
|
||||
(s/keys :req-un [::profile-id ::team-id ::search-term]))
|
||||
(s/keys :req-un [::profile-id ::team-id]
|
||||
:opt-un [::search-term]))
|
||||
|
||||
(sv/defmethod ::search-files
|
||||
[{:keys [pool] :as cfg} {:keys [profile-id team-id search-term] :as params}]
|
||||
(db/exec! pool [sql:search-files
|
||||
profile-id team-id
|
||||
profile-id team-id
|
||||
search-term]))
|
||||
(when search-term
|
||||
(db/exec! pool [sql:search-files
|
||||
profile-id team-id
|
||||
profile-id team-id
|
||||
search-term])))
|
||||
|
||||
|
||||
;; --- Query: Files
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user