mirror of
https://github.com/penpot/penpot.git
synced 2026-09-09 21:49:10 +00:00
Merge pull request #6876 from penpot/niwinz-develop-minor-changes-logical-deletion
✨ Change default status filtering for logical deletion
This commit is contained in:
commit
f7627e515a
@ -10,18 +10,19 @@
|
|||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
[app.util.time :as dt]))
|
[app.util.time :as dt]))
|
||||||
|
|
||||||
|
(def ^:private canceled-status
|
||||||
|
#{"canceled" "unpaid"})
|
||||||
|
|
||||||
(defn get-deletion-delay
|
(defn get-deletion-delay
|
||||||
"Calculate the next deleted-at for a resource (file, team, etc) in function
|
"Calculate the next deleted-at for a resource (file, team, etc) in function
|
||||||
of team settings"
|
of team settings"
|
||||||
[team]
|
[team]
|
||||||
(if-let [subscription (get team :subscription)]
|
(if-let [{:keys [type status]} (get team :subscription)]
|
||||||
(cond
|
(cond
|
||||||
(and (= (:type subscription) "unlimited")
|
(and (= "unlimited" type) (not (contains? canceled-status status)))
|
||||||
(= (:status subscription) "active"))
|
|
||||||
(dt/duration {:days 30})
|
(dt/duration {:days 30})
|
||||||
|
|
||||||
(and (= (:type subscription) "enterprise")
|
(and (= "enterprise" type) (not (contains? canceled-status status)))
|
||||||
(= (:status subscription) "active"))
|
|
||||||
(dt/duration {:days 90})
|
(dt/duration {:days 90})
|
||||||
|
|
||||||
:else
|
:else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user