2016-10-04 14:49:59 +03:00
|
|
|
(ns status-im.data-store.discovery
|
|
|
|
(:require [status-im.data-store.realm.discovery :as data-store]))
|
|
|
|
|
|
|
|
(defn get-all
|
2016-11-10 15:34:25 +03:00
|
|
|
[ordering]
|
|
|
|
(->> (data-store/get-all-as-list ordering)
|
2016-10-04 14:49:59 +03:00
|
|
|
(mapv #(update % :tags vals))))
|
|
|
|
|
|
|
|
(defn save
|
|
|
|
[discovery]
|
|
|
|
(data-store/save discovery))
|
|
|
|
|
2016-11-10 15:34:25 +03:00
|
|
|
(defn exists?
|
|
|
|
[message-id]
|
|
|
|
(data-store/exists? message-id))
|
|
|
|
|
2016-10-04 14:49:59 +03:00
|
|
|
(defn save-all
|
|
|
|
[discoveries]
|
|
|
|
(data-store/save-all discoveries))
|
|
|
|
|
|
|
|
(defn delete
|
|
|
|
[by ordering critical-count to-delete-count]
|
|
|
|
(data-store/delete by ordering critical-count to-delete-count))
|
|
|
|
|
|
|
|
(defn get-all-tags
|
|
|
|
[]
|
|
|
|
(data-store/get-all-tags))
|