Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

179
Visualizações
making generated column optional in NestJS/TypeORM

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?

enter image description here

if user clicks on + button same row should be duplicated.

any suggestions please.

about 4 years ago · Santiago Gelvez
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda