diff options
| author | Adam Soltys <[email protected]> | 2022-08-16 15:31:41 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-08-16 15:31:41 -0700 |
| commit | 770725fbdcc8ea7bf47ef0af5a43a239bef98ff6 (patch) | |
| tree | 445d55b896a63eab5a29204e720a9e74d0629697 /src/routes/invoice | |
| parent | 0b51e1dfd0d099c243d21889fb77fea4769dac0a (diff) | |
| download | coinos-ui-770725fbdcc8ea7bf47ef0af5a43a239bef98ff6.tar.gz coinos-ui-770725fbdcc8ea7bf47ef0af5a43a239bef98ff6.zip | |
sveltekit route migration
Diffstat (limited to 'src/routes/invoice')
| -rw-r--r-- | src/routes/invoice/+server.js (renamed from src/routes/invoice/index.js) | 3 | ||||
| -rw-r--r-- | src/routes/invoice/[id]/+page.server.js (renamed from src/routes/invoice/[id].js) | 4 | ||||
| -rw-r--r-- | src/routes/invoice/[id]/+page.svelte (renamed from src/routes/invoice/[id].svelte) | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/routes/invoice/index.js b/src/routes/invoice/+server.js index cf26b3c6..24fffb21 100644 --- a/src/routes/invoice/index.js +++ b/src/routes/invoice/+server.js @@ -1,3 +1,4 @@ +import { json as json$1 } from '@sveltejs/kit'; import { post } from '$lib/utils'; let network = 'lightning'; @@ -10,5 +11,5 @@ export async function POST({ request }) { user: { username } }); - return { body: { id } }; + return json$1({ id }); } diff --git a/src/routes/invoice/[id].js b/src/routes/invoice/[id]/+page.server.js index a58d02a1..78607545 100644 --- a/src/routes/invoice/[id].js +++ b/src/routes/invoice/[id]/+page.server.js @@ -1,6 +1,6 @@ import { get } from '$lib/utils'; -export async function GET({ params }) { +export async function load({ params }) { let { id } = params; let { amount, @@ -10,5 +10,5 @@ export async function GET({ params }) { user: { username } } = await get(`/invoice?uuid=${id}`); - return { body: { amount, id, rate, username, status, text } }; + return { amount, id, rate, username, status, text }; } diff --git a/src/routes/invoice/[id].svelte b/src/routes/invoice/[id]/+page.svelte index 9ef25251..0252a6b1 100644 --- a/src/routes/invoice/[id].svelte +++ b/src/routes/invoice/[id]/+page.svelte @@ -1,4 +1,6 @@ <script> + throw new Error("@migration task: Add data prop (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292707)"); + import { get, post, reverseFormat } from '$lib/utils'; import { browser } from '$app/env'; import { invoices, user, preferredCurrency } from '$lib/store'; |
