2016-11-23 00:07:33 +08:00
|
|
|
(ns status-im.data-store.discover
|
2016-12-21 12:44:42 +03:00
|
|
|
(:require [status-im.data-store.realm.discover :as data-store])
|
|
|
|
(:refer-clojure :exclude [exists?]))
|
2016-10-04 14:49:59 +03:00
|
|
|
|
|
|
|
(defn get-all
|
2016-11-10 15:34:25 +03:00
|
|
|
[ordering]
|
2016-12-27 19:45:54 +02:00
|
|
|
(mapv #(update % :tags vals)
|
|
|
|
(data-store/get-all-as-list ordering)))
|
2016-10-04 14:49:59 +03:00
|
|
|
|
|
|
|
(defn save
|
2016-11-23 00:07:33 +08:00
|
|
|
[discover]
|
|
|
|
(data-store/save discover))
|
2016-10-04 14:49:59 +03:00
|
|
|
|
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
|
|
|
|
[]
|
2016-12-21 12:44:42 +03:00
|
|
|
(data-store/get-all-tags))
|