mirror of
https://github.com/gnmyt/LicenseAPI.git
synced 2026-01-13 19:41:46 +00:00
Remove plan limitations entirely
This commit is contained in:
@ -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" };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user