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

513
Visualizações
WebStorm / IntelliJ Object Literal error where it shouldn't be, right?

While typing my code in WebStorm OR IntelliJ (both latest versions), the code below gives me an error that in my opinion shouldn't be there.

Am I missing something in my code here or could this be an IDE problem?

Error

Argument of type '{ body: { content: string; fileType: FileType; groups: string[]; name: string; }; }' is not assignable to parameter of type 'CreateTemplate'.
Object literal may only specify known properties, and 'body' does not exist in type 'CreateTemplate'.

Dialog.component.ts

accept(): void {
  this.api.createTemplate({
    body: {
      content: '',
      fileType: this.filetypeFull,
      groups: this.selectedGroups,
      name: this.filename
    }
  })
this.dialogRef.close();

}

api.service.ts

createTemplate(params: {
  body: CreateTemplate
}): Observable<Template> {
  return this.createTemplate$Response(params).pipe(
    map((r: StrictHttpResponse<Template>) => r.body as Template)
  );
}

create-template.model.ts

export interface CreateTemplate {
  content?: string;
  fileType: FileType;
  groups: Array<string>;
  name: string;
}
about 4 years ago · Juan Pablo Isaza
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