Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ package-lock.json
/build

# OS
**.DS_Store
.DS_Store
**/.DS_Store
Thumbs.db

# Env
Expand Down
Binary file removed src/.DS_Store
Binary file not shown.
28 changes: 19 additions & 9 deletions src/lib/remote/colocation-reserve.remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ export type ReserveResult =
error: string;
};

async function sendDiscordNotification(webhookUrl: string, webhookBody: unknown) {
const response = await fetch(webhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(webhookBody)
});

if (!response.ok) {
throw new Error(`Response status: ${response.status}, Response content: ${await response.text()}`);
}
}

async function createPaymentLink(plan: string, email: string, name: string): Promise<string> {
const event = getRequestEvent();
if (!event) {
Expand Down Expand Up @@ -64,16 +76,14 @@ async function createPaymentLink(plan: string, email: string, name: string): Pro
};

if (env.COLOCATION_RESERVATION_DISCORD_WEBHOOK) {
const response = await fetch(env.COLOCATION_RESERVATION_DISCORD_WEBHOOK, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(webhookBody)
const notification = sendDiscordNotification(
env.COLOCATION_RESERVATION_DISCORD_WEBHOOK,
webhookBody
).catch((error) => {
console.error('Failed to send Discord colocation reservation notification', error);
});
if (!response.ok) {
throw new Error(
`Response status: ${response.status}, Response content: ${await response.text()}`
);
}

event.platform?.ctx.waitUntil(notification);
} else {
console.log('would have called discord colocation webhook');
console.log(webhookBody);
Expand Down
1 change: 1 addition & 0 deletions src/routes/+layout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const prerender = true;
1 change: 1 addition & 0 deletions src/routes/services/colocation/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const prerender = false;
2 changes: 2 additions & 0 deletions src/routes/sitemap.xml/+server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as sitemap from 'super-sitemap/sveltekit';
import type { RequestHandler } from '@sveltejs/kit';

export const prerender = true;

export const GET: RequestHandler = async () => {
return await sitemap.response({
origin: 'https://fyrastack.com'
Expand Down
Binary file removed static/.DS_Store
Binary file not shown.
4 changes: 3 additions & 1 deletion static/.assetsignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
_worker.js
_routes.json
_routes.json
.DS_Store
**/.DS_Store
Binary file removed static/assets/.DS_Store
Binary file not shown.