diff options
Diffstat (limited to 'lib/utils.js')
| -rw-r--r-- | lib/utils.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/utils.js b/lib/utils.js index 866bbaf9..c68d222b 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -69,3 +69,10 @@ export let getUser = async (username) => { if (username === "undefined") fail("invalid user"); return migrate(username); }; + +export let getInvoice = async (hash) => { + let iid = await g(`invoice:${hash}`); + if (iid && iid.id) iid = iid.id; + else if (iid && iid.hash) iid = iid.hash; + return await g(`invoice:${iid}`); +} |
