@@ -1,4 +1,5 @@
|
||||
import Company from "./entities/company";
|
||||
import config from "../../core/config";
|
||||
import {
|
||||
CompanyFeaturesEnum,
|
||||
CompanyLimitsEnum,
|
||||
@@ -53,6 +54,9 @@ export function formatCompany(
|
||||
[CompanyFeaturesEnum.CHAT_EDIT_FILES]: true,
|
||||
[CompanyFeaturesEnum.CHAT_UNLIMITED_STORAGE]: true,
|
||||
[CompanyFeaturesEnum.COMPANY_INVITE_MEMBER]: true,
|
||||
// use the config value for this one
|
||||
[CompanyFeaturesEnum.COMPANY_SEARCH_USERS]:
|
||||
(config.get("drive.featureSearchUsers") as boolean) || true,
|
||||
},
|
||||
{
|
||||
...(res.plan?.features || {}),
|
||||
@@ -62,6 +66,8 @@ export function formatCompany(
|
||||
},
|
||||
);
|
||||
|
||||
console.log("🚀🚀 res.plan.features: ", res.plan.features);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ export const companyObjectSchema = {
|
||||
[CompanyFeaturesEnum.CHAT_MULTIPLE_WORKSPACES]: { type: "boolean" },
|
||||
[CompanyFeaturesEnum.CHAT_UNLIMITED_STORAGE]: { type: "boolean" },
|
||||
[CompanyFeaturesEnum.COMPANY_INVITE_MEMBER]: { type: "boolean" },
|
||||
[CompanyFeaturesEnum.COMPANY_SEARCH_USERS]: { type: "boolean" },
|
||||
guests: { type: "number" }, // to rename or delete
|
||||
members: { type: "number" }, // to rename or delete
|
||||
storage: { type: "number" }, // to rename or delete
|
||||
|
||||
@@ -83,6 +83,7 @@ export enum CompanyFeaturesEnum {
|
||||
CHAT_EDIT_FILES = "chat:edit_files",
|
||||
CHAT_UNLIMITED_STORAGE = "chat:unlimited_storage",
|
||||
COMPANY_INVITE_MEMBER = "company:invite_member",
|
||||
COMPANY_SEARCH_USERS = "company:search_users",
|
||||
}
|
||||
|
||||
export type CompanyFeaturesObject = {
|
||||
@@ -92,6 +93,7 @@ export type CompanyFeaturesObject = {
|
||||
[CompanyFeaturesEnum.CHAT_EDIT_FILES]?: boolean;
|
||||
[CompanyFeaturesEnum.CHAT_UNLIMITED_STORAGE]?: boolean;
|
||||
[CompanyFeaturesEnum.COMPANY_INVITE_MEMBER]?: boolean;
|
||||
[CompanyFeaturesEnum.COMPANY_SEARCH_USERS]?: boolean;
|
||||
};
|
||||
|
||||
export type CompanyLimitsObject = {
|
||||
|
||||
Reference in New Issue
Block a user