mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
change reports + chage pricing
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
|
||||
import z from 'zod';
|
||||
import { PremiumModel } from '~/shared/schema/PremiumSchema';
|
||||
import { ReportCustomizationModel } from "~/shared/schema/report/ReportCustomizationSchema";
|
||||
|
||||
const ZUpdateCustomizationBody = z.object({
|
||||
@@ -11,6 +12,11 @@ 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 createError({ status: 400, message: 'Not premium' });
|
||||
if (premium.premium_type == 0) return createError({ status: 400, message: 'Not premium' });
|
||||
|
||||
const body = await readBody(event);
|
||||
|
||||
const bodyData = ZUpdateCustomizationBody.parse(body);
|
||||
|
||||
Reference in New Issue
Block a user