revert the updateData method
This commit is contained in:
@@ -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,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user