mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-13 02:53:50 +00:00
feat(#11): Add the description and fetching the images from Stripe on checkout success page
This commit is contained in:
@@ -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