test: Fix failing tests on MySQL for Public API (#3520)
* ⚡ Generalize transformer * ⚡ Use transformer * 🧪 Fix expectations
This commit is contained in:
@@ -21,7 +21,7 @@ import { Role } from './Role';
|
||||
import { SharedWorkflow } from './SharedWorkflow';
|
||||
import { SharedCredentials } from './SharedCredentials';
|
||||
import { NoXss } from '../utils/customValidators';
|
||||
import { answersFormatter, lowerCaser } from '../utils/transformers';
|
||||
import { objectRetriever, lowerCaser } from '../utils/transformers';
|
||||
|
||||
export const MIN_PASSWORD_LENGTH = 8;
|
||||
|
||||
@@ -98,7 +98,7 @@ export class User {
|
||||
@Column({
|
||||
type: resolveDataType('json') as ColumnOptions['type'],
|
||||
nullable: true,
|
||||
transformer: answersFormatter,
|
||||
transformer: objectRetriever,
|
||||
})
|
||||
personalizationAnswers: IPersonalizationSurveyAnswers | null;
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import * as config from '../../../config';
|
||||
import { DatabaseType, IWorkflowDb } from '../..';
|
||||
import { TagEntity } from './TagEntity';
|
||||
import { SharedWorkflow } from './SharedWorkflow';
|
||||
import { objectRetriever } from '../utils/transformers';
|
||||
|
||||
function resolveDataType(dataType: string) {
|
||||
const dbType = config.getEnv('database.type');
|
||||
@@ -95,6 +96,7 @@ export class WorkflowEntity implements IWorkflowDb {
|
||||
@Column({
|
||||
type: resolveDataType('json') as ColumnOptions['type'],
|
||||
nullable: true,
|
||||
transformer: objectRetriever,
|
||||
})
|
||||
staticData?: IDataObject;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user