Files
twenty/packages/twenty-server/test/integration/twenty-config/utils/update-config-variable.util.ts
T
Félix MalfaitandGitHub 8b4b9ef8da Change type import rule (#13751)
Forcing "type" to be explicit, works best will rollup on the frontend to
exclude depdendencies
2025-08-08 01:27:05 +02:00

30 lines
1012 B
TypeScript

import { type PerformTwentyConfigQueryParams } from 'test/integration/twenty-config/types/perform-twenty-config-query.type';
import { makeAdminPanelAPIRequest } from './make-admin-panel-api-request.util';
import {
type UpdateConfigVariableFactoryInput,
updateConfigVariableQueryFactory,
} from './update-config-variable.query-factory.util';
export const updateConfigVariable = async ({
input,
expectToFail = false,
}: PerformTwentyConfigQueryParams<UpdateConfigVariableFactoryInput>) => {
const graphqlOperation = updateConfigVariableQueryFactory({
key: input.key,
value: input.value,
});
const response = await makeAdminPanelAPIRequest(graphqlOperation);
if (!expectToFail) {
expect(response.body.data).toBeDefined();
expect(response.body.errors).toBeUndefined();
expect(response.body.data.updateDatabaseConfigVariable).toBeDefined();
} else {
expect(response.body.errors).toBeDefined();
}
return { data: response.body.data, errors: response.body.errors };
};