Remove plan limitations entirely

This commit is contained in:
Mathias Wagner
2024-07-21 12:28:17 +02:00
parent dc6add0760
commit f250defbc4
9 changed files with 4 additions and 74 deletions

View File

@ -1,7 +1,6 @@
import { checkProjectAccess } from "@controller/projects";
import { IKeyRole } from "@models/AccessKey";
import { ILicenseMetaType, IMetaData, MetaData } from "@models/MetaData";
import { planLimits } from "../limits/plans";
export const isValidMetaType = (type: string, value: string) => {
if (type === ILicenseMetaType.TEXT) return true;
@ -51,9 +50,6 @@ export const createMetaData = async (userId: string, projectId: string, config:
const access = await checkProjectAccess(IKeyRole.MANAGE)(userId, projectId);
if ("code" in access) return access;
const count = await MetaData.countDocuments({ projectId: String(access._id) });
if (count >= planLimits[access.plan].META) return { code: 95, message: "You have exceeded the meta item limit" };
const meta = await MetaData.findOne({ projectId: String(access._id), name: config.name });
if (meta !== null) return { code: 8003, message: "The provided meta item name is already in use" };