mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-13 11:03:49 +00:00
feat(#11): Add the description and fetching the images from Stripe on checkout success page
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { formatCurrency } from '$lib/utils/currency';
|
||||
export let imgAlt = '';
|
||||
export let imgSrc = '';
|
||||
// export let itemCategoryDescription = '';
|
||||
export let itemCategoryDescription = '';
|
||||
export let itemName = '';
|
||||
export let price = 0;
|
||||
export let quantity = 0;
|
||||
@@ -20,11 +20,11 @@
|
||||
<h5 class="font-semibold text-xl leading-8 text-black max-[550px]:text-center">
|
||||
{itemName}
|
||||
</h5>
|
||||
<!-- <p
|
||||
<p
|
||||
class="font-normal text-lg leading-8 text-gray-500 my-2 min-[550px]:my-3 max-[550px]:text-center"
|
||||
>
|
||||
{itemCategoryDescription}
|
||||
</p> -->
|
||||
</p>
|
||||
|
||||
<div class="flex items-center">
|
||||
<h6
|
||||
|
||||
@@ -441,6 +441,20 @@ const getActiveProductsWithPrices = async (limit = 10, offset = 0) => {
|
||||
return { products: products as ProductWithPrices[], count };
|
||||
};
|
||||
|
||||
const getProductById = async (productId: string) => {
|
||||
const { data: product, error } = await supabaseAdmin
|
||||
.from('products')
|
||||
.select('*')
|
||||
.eq('id', productId)
|
||||
.single();
|
||||
|
||||
if (error) {
|
||||
throw new Error(`Error fetching product: ${error.message}`);
|
||||
}
|
||||
|
||||
return product as Product;
|
||||
};
|
||||
|
||||
export {
|
||||
upsertProductRecord,
|
||||
upsertPriceRecord,
|
||||
@@ -453,5 +467,6 @@ export {
|
||||
addCredits,
|
||||
deductCredits,
|
||||
getUserCredits,
|
||||
getActiveProductsWithPrices
|
||||
getActiveProductsWithPrices,
|
||||
getProductById
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user