is there a way to update order of related items in Typeorm?
For example:
First I’m saving item:
const item = new Item();
item.name = 'item';
item.relations = [related1,related2,related3];
this.dataSource.manager.save(item);
Later I want to update item:
const item = await this.dataSource.getRepository(Item)
.findOne({
where: { id: id }
});
item.name = 'updatedItem';
item.relations = [related3,related2,related1];
this.dataSource.manager.save(item);
Unfortunatelly, all changes are saved but relation order is still the same.
What am I doing wrong?