mirror of
https://github.com/status-im/status-react.git
synced 2025-02-08 17:15:52 +00:00
GET /networks endpoint for development server
Signed-off-by: Aleksandr Pantiukhov <alwxndr@gmail.com>
This commit is contained in:
parent
b293fb11e3
commit
654950dcaa
@ -50,6 +50,17 @@
|
|||||||
:network-id network-id
|
:network-id network-id
|
||||||
:reason reason}]})}))
|
:reason reason}]})}))
|
||||||
|
|
||||||
|
(defmethod process-request! [:GET "networks" nil]
|
||||||
|
[{:keys [cofx]}]
|
||||||
|
(let [{:keys [networks network]} (get-in cofx [:db :account/account])
|
||||||
|
networks (->> networks
|
||||||
|
(map (fn [[id m]]
|
||||||
|
[id (-> m
|
||||||
|
(select-keys [:id :name :config])
|
||||||
|
(assoc :active? (= id network)))]))
|
||||||
|
(into {}))]
|
||||||
|
{:dev-server/respond [200 {:networks networks}]}))
|
||||||
|
|
||||||
(defmethod process-request! [:DELETE "network" nil]
|
(defmethod process-request! [:DELETE "network" nil]
|
||||||
[{:keys [cofx data]}]
|
[{:keys [cofx data]}]
|
||||||
(network/delete
|
(network/delete
|
||||||
|
Loading…
x
Reference in New Issue
Block a user