diff options
| author | Adam Soltys <[email protected]> | 2023-02-22 19:38:55 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-02-23 00:31:21 -0800 |
| commit | 2e7d45bc545fdecd92fa791b69b5cfbc8f0cc999 (patch) | |
| tree | 6cc2ce81bd703aab912f3594d8c1c2086fcc731d /src/lib/utils.js | |
| parent | c9a316b60200b760f5f2afe97be13a02e76b9205 (diff) | |
| download | coinos-ui-2e7d45bc545fdecd92fa791b69b5cfbc8f0cc999.tar.gz coinos-ui-2e7d45bc545fdecd92fa791b69b5cfbc8f0cc999.zip | |
fee slider wip
Diffstat (limited to 'src/lib/utils.js')
| -rw-r--r-- | src/lib/utils.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/utils.js b/src/lib/utils.js index 86f722b9..1d064c9a 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -148,6 +148,11 @@ export const login = async (user, cookies) => { export const auth = (cookies) => ({ authorization: `Bearer ${cookies.get('token')}` }); export const fiat = (amount, rate) => (amount * rate) / sats; +export const fd = async (req) => { + let obj = Object.fromEntries(await req.formData()); + for (let k in obj) (obj[k] === 'undefined' && (obj[k] = undefined)) ||( obj[k] === 'false' && (obj[k] = false)); + return obj; +}; export const f = (s, currency) => new Intl.NumberFormat('en-US', { |
