From dcd4fe70f6f23a5ac2df3b773fea89c1acd878b6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 5 Aug 2022 10:21:48 -0700 Subject: lightning withdrawals --- src/lib/utils.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/lib/utils.js') diff --git a/src/lib/utils.js b/src/lib/utils.js index a812c136..24f94d40 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -18,11 +18,12 @@ export const get = (url, headers = { accept: 'application/json' }) => } }); -export const post = (url, body) => - fetch(base + url, { +export const post = (url, body, headers) => { + headers = { ...headers, accept: 'application/json', 'content-type': 'application/json' }; + return fetch(base + url, { method: 'POST', body: JSON.stringify(body), - headers: { accept: 'application/json', 'content-type': 'application/json' } + headers }) .then((r) => r.text()) .then((body) => { @@ -37,6 +38,7 @@ export const post = (url, body) => return body; }); +} export const copy = (text) => { navigator.clipboard.writeText(text); -- cgit v1.2.3