Skip to content

Cannot assign entities to Relation annotated properties. #5

Open
@stringthread

Description

@stringthread

Describe the bug

Type 'Item' is not assignable to type 'Relation<Item>'

Minimal reproducible example

@Entity()
class Item {
  id: number;
}

@Entity()
class List {
  id: number;

  @ManyToMany()
  items: Relation<Item>[];
}

const list = new List();
const item = new Item();
list.items = [item]; // ERROR

Expected behavior

It should be possible to assign entities into properties.

Specifications

  • OS: Ubuntu 22.0.4 LTS
  • Version 1.0.1

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions