Merge branch '14-add-ability-to-record-that-a-user-has-gained-access-to-a-software-product-after-purchase-1' of https://github.com/jcreek/SvelteKitSaasBoilerplate into 14-add-ability-to-record-that-a-user-has-gained-access-to-a-software-product-after-purchase-1

This commit is contained in:
OllyNicholass
2024-07-05 15:12:37 +01:00
2 changed files with 5 additions and 9 deletions
+2 -5
View File
@@ -1,11 +1,8 @@
import { createClient } from '@supabase/supabase-js';
import stripe from 'stripe';
import type { Database, Tables, TablesInsert } from '$types/supabase';
import {
PUBLIC_SUPABASE_URL,
SUPABASE_SERVICE_ROLE_KEY,
PUBLIC_STRIPE_SECRET_KEY
} from '$env/static/public';
import { PUBLIC_SUPABASE_URL, PUBLIC_STRIPE_SECRET_KEY } from '$env/static/public';
import { SUPABASE_SERVICE_ROLE_KEY } from '$env/static/private';
const toDateTime = (secs: number) => {
const t = new Date(+0); // Unix epoch start.
+3 -4
View File
@@ -82,10 +82,9 @@ export const POST: RequestHandler = async ({ request }) => {
}
// Return a response to acknowledge receipt of the event
return {
status: 200,
body: { received: true }
};
return new Response(JSON.stringify({ received: true }), {
status: 200
});
} catch (err) {
console.log(`Webhook Error: ${err.message}`);
return {