mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
17 lines
495 B
TypeScript
17 lines
495 B
TypeScript
import { PaymentServiceHelper } from '~/server/services/PaymentServiceHelper';
|
|
import { PremiumModel } from '~/shared/schema/PremiumSchema';
|
|
|
|
export default defineEventHandler(async event => {
|
|
|
|
const data = await getRequestData(event, []);
|
|
if (!data) return;
|
|
|
|
const premium = await PremiumModel.findOne({ user_id: data.user.id })
|
|
if (!premium) return;
|
|
|
|
const body = await readBody(event);
|
|
|
|
return await PaymentServiceHelper.update_customer_info(data.user.id, body);
|
|
|
|
|
|
}); |