Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

512
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!