revert the updateData method

This commit is contained in:
Niels Lyngsø
2023-06-09 08:41:27 +02:00
parent 8100afd561
commit df261ff233
2 changed files with 6 additions and 6 deletions

View File

@@ -9,15 +9,15 @@ export class UmbEntityTreeData<TreeItemType extends TreeItemPresentationModel> {
this.#detailDatabase = detailDatabase;
}
move(ids: Array<string>, destinationKey: string) {
const destinationItem = this.#detailDatabase.getById(destinationKey);
if (!destinationItem) throw new Error(`Destination item with key ${destinationKey} not found`);
move(ids: Array<string>, destinationId: string) {
const destinationItem = this.#detailDatabase.getById(destinationId);
if (!destinationItem) throw new Error(`Destination item with key ${destinationId} not found`);
const items = this.#detailDatabase.getByIds(ids);
const movedItems = items.map((item) => {
return {
...item,
parentId: destinationKey,
parentId: destinationId,
};
});

View File

@@ -94,8 +94,8 @@ export class UmbEntityData<T extends UmbEntityBase> extends UmbData<T> {
return deletedKeys;
}
updateData(id: string, updateItem: T) {
const itemIndex = this.data.findIndex((item) => item.id === id);
updateData(updateItem: T) {
const itemIndex = this.data.findIndex((item) => item.id === updateItem.id);
const item = this.data[itemIndex];
if (!item) return;