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;
}