Fix bug when deleting the last item

This commit is contained in:
Rene Vergara 2022-02-02 12:26:21 -06:00
parent a22dc1aac3
commit a42f04cd4a

View file

@ -28,6 +28,8 @@ export class ItemService{
this.dataStore.items = ItemDataResponse.body!.items; this.dataStore.items = ItemDataResponse.body!.items;
this._itemsUpdated.next(Object.assign({},this.dataStore).items); this._itemsUpdated.next(Object.assign({},this.dataStore).items);
} else { } else {
this.dataStore.items = [];
this._itemsUpdated.next(Object.assign({},this.dataStore).items);
console.log('No items found'); console.log('No items found');
} }
}); });