feat: add bee-desktop settings capabilities (#323)

* refactor: make the config readonly and extract endpoint calls to hook (+2 squashed commits)
Squashed commits:
[91ffe45] feat: add swap-endpoint
[e1d0c3a] feat: add bee-desktop settings capabilities

* feat: use the request mechanism that uses the bee-desktop API key

* fix: properly reset the error or on error set the config to null
This commit is contained in:
Vojtech Simetka
2022-04-29 12:30:46 +05:00
committed by GitHub
parent 8114fa7d73
commit 87b0b71cc6
5 changed files with 96 additions and 8 deletions
+2 -2
View File
@@ -2,8 +2,8 @@
import axios from 'axios'
export function getJson(url: string): Promise<Record<string, any>> {
return sendRequest(url, 'GET')
export function getJson<T extends Record<string, any>>(url: string): Promise<T> {
return sendRequest(url, 'GET') as Promise<T>
}
export function postJson(url: string, data?: Record<string, any>): Promise<Record<string, unknown>> {