Skip to content

Commit 26d7d04

Browse files
committed
chore: 🔥 Switch to api.invoicelink.io
1 parent cb2c214 commit 26d7d04

File tree

7 files changed

+13
-119
lines changed

7 files changed

+13
-119
lines changed

apps/app/src/routes/(app)/api/changelog/+server.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

apps/app/src/routes/(app)/api/invoice/+server.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.

apps/app/src/routes/(app)/api/templatePreview/+server.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

apps/app/src/routes/(app)/invoices/management/manage/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
class="tooltip tooltip-accent"
109109
data-tip="Save a copy"
110110
target="_blank"
111-
href="/api/invoice?id={$form.id}&type=invoice&download=true"
111+
href="https://api.invoicelink.io/invoice?id={$form.id}&type=invoice&download=true"
112112
>
113113
<Icon name="download" />
114114
</a>

apps/app/src/routes/(app)/invoices/template/design/+page.server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const load = (async ({ parent, locals, url }) => {
3939
}) satisfies PageServerLoad;
4040

4141
export const actions: Actions = {
42-
create: async ({ request, locals, url }) => {
42+
create: async ({ request, locals }) => {
4343
const { user } = locals;
4444
const form = await superValidate(request, zod(schema));
4545
if (!form.valid) {
@@ -58,7 +58,7 @@ export const actions: Actions = {
5858
});
5959

6060
// grab the screenshot of the template
61-
const imageUrl = `${url.origin}/api/templatePreview?styleId=${res.id}`;
61+
const imageUrl = `https://api.invoicelink.io/preview?styleId=${res.id}`;
6262
const base64image = await fetch(imageUrl)
6363
.then((res) => res.arrayBuffer())
6464
.then((buf) => arrayBufferToBase64(buf, 'image/webp'));
@@ -83,7 +83,7 @@ export const actions: Actions = {
8383
return message(form, 'Template created');
8484
}
8585
},
86-
update: async ({ request, locals, url }) => {
86+
update: async ({ request, locals }) => {
8787
const { user } = locals;
8888
const form = await superValidate(request, zod(schema));
8989
if (!form.valid) {
@@ -105,7 +105,7 @@ export const actions: Actions = {
105105
}
106106
});
107107

108-
const imageUrl = `${url.origin}/api/templatePreview?styleId=${form.data.id}`;
108+
const imageUrl = `https://api.invoicelink.io/preview?styleId=${form.data.id}`;
109109
const base64image = await fetch(imageUrl)
110110
.then((res) => res.arrayBuffer())
111111
.then((buf) => arrayBufferToBase64(buf, 'image/webp'));

apps/app/src/routes/pay/+page.svelte

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@
4848
<div data-theme="light" class="flex h-svh w-full flex-col pb-20">
4949
{#if data.pay}
5050
<div
51-
class="bg-pattern relative flex h-[25vh] w-full flex-col items-center justify-center bg-base-200 text-center"
51+
class="bg-pattern bg-base-200 relative flex h-[25vh] w-full flex-col items-center justify-center text-center"
5252
>
5353
<div
54-
class="absolute bottom-0 z-10 -mb-[10vh] flex h-auto w-[90vw] flex-col items-center justify-center gap-4 rounded-xl bg-base-100 p-10 shadow-lg sm:mx-auto sm:w-full sm:max-w-xl"
54+
class="bg-base-100 absolute bottom-0 z-10 -mb-[10vh] flex h-auto w-[90vw] flex-col items-center justify-center gap-4 rounded-xl p-10 shadow-lg sm:mx-auto sm:w-full sm:max-w-xl"
5555
>
5656
<div class="flex flex-col items-center">
5757
<div class="-mt-4 mb-4">
@@ -78,8 +78,9 @@
7878
</div>
7979
</div>
8080
<div class="mt-[10vh] flex w-full flex-grow items-center justify-center gap-2 py-10">
81-
<a href="/api/invoice?id={data?.pay.id}&type={data.type}&download=true" class="btn w-36"
82-
>Save invoice</a
81+
<a
82+
href="https://api.invoicelink.io/invoice?id={data?.pay.id}&type={data.type}&download=true"
83+
class="btn w-36">Save invoice</a
8384
>
8485
{#if !isPaid}
8586
{#if integrations.payfast && selectedPaymentOption.value === 'payfast'}

apps/pay/src/routes/[id]/+page.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@
7474
</div>
7575
</div>
7676
<div class="mt-[10vh] flex w-full flex-grow items-center justify-center gap-2 py-10">
77-
<a href="/api/invoice?id={data?.pay.id}&type={data.type}&download=true" class="btn w-36"
78-
>Save invoice</a
77+
<a
78+
href="https://api.invoicelink.io/invoice?id={data?.pay.id}&type={data.type}&download=true"
79+
class="btn w-36">Save invoice</a
7980
>
8081
{#if !isPaid}
8182
{#if integrations.payfast && selectedPaymentOption.value === 'payfast'}

0 commit comments

Comments
 (0)