Commit d84a8af6 authored by nanahira's avatar nanahira

fix

parent 34934752
Pipeline #10445 passed with stages
in 2 minutes and 33 seconds
...@@ -30,6 +30,7 @@ export const RelationColumn = ( ...@@ -30,6 +30,7 @@ export const RelationColumn = (
IsInt(), IsInt(),
IsPositive(), IsPositive(),
]); ]);
export const StringRelationColumn = ( export const StringRelationColumn = (
description = '对应编号', description = '对应编号',
notNull = false, notNull = false,
...@@ -38,7 +39,12 @@ export const StringRelationColumn = ( ...@@ -38,7 +39,12 @@ export const StringRelationColumn = (
) => ) =>
MergePropertyDecorators([ MergePropertyDecorators([
Column('varchar', { length: 32, nullable: !notNull, ...columnExtras }), Column('varchar', { length: 32, nullable: !notNull, ...columnExtras }),
ApiProperty({ type: String, description, ...propertyExtras }), ApiProperty({
type: String,
required: notNull,
description,
...propertyExtras,
}),
...(notNull ? [] : [IsOptional()]), ...(notNull ? [] : [IsOptional()]),
IsNotEmpty(), IsNotEmpty(),
]); ]);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment