Files
twenty/packages/twenty-front/src/modules/settings/logic-functions/hooks/useExecuteOneLogicFunction.ts
T
Charles Bochet da6f1bbef3 Rename serverlessFunction to logicFunction (#17494)
## Summary

Rename "Serverless Function" to "Logic Function" across the codebase for
clearer naming.

### Environment Variable Changes

| Old | New |
|-----|-----|
| `SERVERLESS_TYPE` | `LOGIC_FUNCTION_TYPE` |
| `SERVERLESS_LAMBDA_REGION` | `LOGIC_FUNCTION_LAMBDA_REGION` |
| `SERVERLESS_LAMBDA_ROLE` | `LOGIC_FUNCTION_LAMBDA_ROLE` |
| `SERVERLESS_LAMBDA_SUBHOSTING_URL` |
`LOGIC_FUNCTION_LAMBDA_SUBHOSTING_URL` |
| `SERVERLESS_LAMBDA_ACCESS_KEY_ID` |
`LOGIC_FUNCTION_LAMBDA_ACCESS_KEY_ID` |
| `SERVERLESS_LAMBDA_SECRET_ACCESS_KEY` |
`LOGIC_FUNCTION_LAMBDA_SECRET_ACCESS_KEY` |

### Breaking Changes

- Environment variables must be updated in production deployments
- Database migration renames `serverlessFunction` → `logicFunction`
tables
2026-01-28 01:42:19 +01:00

28 lines
912 B
TypeScript

import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { EXECUTE_ONE_LOGIC_FUNCTION } from '@/settings/logic-functions/graphql/mutations/executeOneLogicFunction';
import { useMutation } from '@apollo/client';
import {
type ExecuteOneLogicFunctionMutation,
type ExecuteOneLogicFunctionMutationVariables,
type ExecuteLogicFunctionInput,
} from '~/generated-metadata/graphql';
export const useExecuteOneLogicFunction = () => {
const apolloMetadataClient = useApolloCoreClient();
const [mutate] = useMutation<
ExecuteOneLogicFunctionMutation,
ExecuteOneLogicFunctionMutationVariables
>(EXECUTE_ONE_LOGIC_FUNCTION, {
client: apolloMetadataClient,
});
const executeOneLogicFunction = async (input: ExecuteLogicFunctionInput) => {
return await mutate({
variables: {
input,
},
});
};
return { executeOneLogicFunction };
};