Remove serverless functions from settings (#9105)

closes https://github.com/twentyhq/twenty/issues/8727

@Bonapara wants to keep the code for now so I ended up by setting the
`isFunctionSettingsEnabled` constants to false in the codebase
This commit is contained in:
martmull
2024-12-17 17:57:17 +01:00
committed by GitHub
parent b033a50d7c
commit e492efb79e
2 changed files with 9 additions and 10 deletions

View File

@ -38,7 +38,7 @@ export const seedFeatureFlags = async (
{
key: FeatureFlagKey.IsFunctionSettingsEnabled,
workspaceId: workspaceId,
value: true,
value: false,
},
{
key: FeatureFlagKey.IsWorkflowEnabled,

View File

@ -35,17 +35,16 @@ export class ServerlessFunctionResolver {
) {}
async checkFeatureFlag(workspaceId: string) {
const isFunctionSettingsEnabled =
await this.featureFlagRepository.findOneBy({
workspaceId,
key: FeatureFlagKey.IsFunctionSettingsEnabled,
value: true,
});
const isWorkflowEnabled = await this.featureFlagRepository.findOneBy({
workspaceId,
key: FeatureFlagKey.IsWorkflowEnabled,
value: true,
});
if (!isFunctionSettingsEnabled) {
if (!isWorkflowEnabled) {
throw new ServerlessFunctionException(
`IS_FUNCTION_SETTINGS_ENABLED feature flag is not set to true for this workspace`,
ServerlessFunctionExceptionCode.SERVERLESS_FUNCTION_NOT_FOUND,
`IS_WORKFLOW_ENABLED feature flag is not set to true for this workspace`,
ServerlessFunctionExceptionCode.FEATURE_FLAG_INVALID,
);
}
}