I have a scenario in which I have to make generated column optional. actually we have to generate the field if it is not present.
@ApiProperty()
@Generated('rowid') //this is generating value automatically
@Column({name:"certificate_no",type: 'varchar'})
certificateNo?: string;
actually in UI we have a functionality in which we have to duplicate the row. so when API gets called and certificateNo is not present then this value should be generated. if it is present then present value should be inserted into database.
I am putting in DTO.
@ApiProperty()
@IsOptional()
@IsString()
certificateNo?: string;
Actually it is generating certificateNo everytime even if it is present. is there anyway to handle this scenario?
if user clicks on + button same row should be duplicated.
any suggestions please.