From a42f04cd4a205dde30a3cddb07bba8b100deb6d1 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Wed, 2 Feb 2022 12:26:21 -0600 Subject: [PATCH] Fix bug when deleting the last item --- src/app/items/items.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/items/items.service.ts b/src/app/items/items.service.ts index f18e8a7..1cb6cb2 100644 --- a/src/app/items/items.service.ts +++ b/src/app/items/items.service.ts @@ -28,6 +28,8 @@ export class ItemService{ this.dataStore.items = ItemDataResponse.body!.items; this._itemsUpdated.next(Object.assign({},this.dataStore).items); } else { + this.dataStore.items = []; + this._itemsUpdated.next(Object.assign({},this.dataStore).items); console.log('No items found'); } });