Skip to content

Commit 1ce6314

Browse files
committed
Merge branch 'development'
2 parents edc315e + 44c27c7 commit 1ce6314

File tree

6 files changed

+342
-58
lines changed

6 files changed

+342
-58
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ EggCart is a Telegram Bot designed to manage your grocery list efficiently. Buil
1414

1515
## Screenshot
1616

17-
<img alt="AppScreenshot" src="assets/egg_cart_screenshot.jpg" width="512">
17+
<img alt="AppScreenshot" src="assets/egg_cart_screenshot.png" width="512">
1818

1919
## Installation
2020
To get EggCart up and running, follow these steps:

assets/egg_cart_screenshot.jpg

-95.6 KB
Binary file not shown.

assets/egg_cart_screenshot.png

244 KB
Loading

src/controllers/EggoList.js

+13
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,19 @@ class EggoList {
6666
}
6767
}
6868

69+
/**
70+
* Finds an item in the database by its ID.
71+
* This function queries the EggoList model to find a single item that matches the given ID.
72+
*
73+
* @param {number} itemId - The ID of the item to be found.
74+
* @returns {Promise<Object|null>} A promise that resolves to the found item or null if no item is found.
75+
*/
76+
async findItemById(itemId) {
77+
return await EggoListModel.findOne({
78+
where: {id: itemId}
79+
});
80+
}
81+
6982
/**
7083
* Update an item in the list.
7184
* @param {number} itemId - ID of the item to update.

src/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
const path = require('path');
22

3-
const config = require(path.join(__dirname, 'config'));
4-
53
const EggCart = require(path.join(__dirname, 'modules', 'Eggcart'))
64
/**
75
* Initialize the EggCart with the database location.
@@ -14,5 +12,6 @@ eggCart.addItem()
1412
eggCart.getList()
1513
eggCart.deleteItem()
1614
eggCart.clearList()
15+
eggCart.start()
1716
eggCart.help()
1817
eggCart.connect()

0 commit comments

Comments
 (0)