aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/invoice/index.js
blob: d89f7130c1aab46eec19ae0039f9602526860ae9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
import { post } from '$lib/utils';

let network = 'lightning';

export async function POST({ request }) {
  let { amount, rate, username } = await request.json();
	let { text } = await post('/lightning/invoice', );
	let { uuid: id } = await post('/invoice', { invoice: { amount, currency: 'USD', network, rate, text }, user: { username } });

	return { body: { id } };
}