mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-11 16:28:37 +01:00
fix dashboard premium tables
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
|
||||
import StripeService from '~/server/services/StripeService';
|
||||
import { PremiumModel } from '~/shared/schema/PremiumSchema';
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
const data = await getRequestData(event, []);
|
||||
if (!data) return;
|
||||
|
||||
const { project } = data;
|
||||
const premium = await PremiumModel.findOne({ user_id: data.user.id })
|
||||
if (!premium) return;
|
||||
|
||||
const customer = await StripeService.getCustomer(project.customer_id);
|
||||
const customer = await StripeService.getCustomer(premium.customer_id);
|
||||
if (customer?.deleted) return;
|
||||
|
||||
|
||||
return customer?.address;
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user