I am new to coding so I can not understand and solve this problem if you want please help me.
C:\projects\assignment-11\spice-warehouse-server\node_modules\bson\lib\error.js:41 var _this = _super.call(this, message) || this; ^
BSONTypeError: Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer at new BSONTypeError (C:\projects\assignment-11\spice-warehouse-server\node_modules\bson\lib\error.js:41:28) at new ObjectId (C:\projects\assignment-11\spice-warehouse-server\node_modules\bson\lib\objectid.js:66:23) at ObjectId (C:\projects\assignment-11\spice-warehouse-server\node_modules\bson\lib\objectid.js:26:20) at C:\projects\assignment-11\spice-warehouse-server\index.js:38:33 at Layer.handle [as handle_request] (C:\projects\assignment-11\spice-warehouse-server\node_modules\express\lib\router\layer.js:95:5) at next (C:\projects\assignment-11\spice-warehouse-server\node_modules\express\lib\router\route.js:144:13) at Route.dispatch (C:\projects\assignment-11\spice-warehouse-server\node_modules\express\lib\router\route.js:114:3) at Layer.handle [as handle_request] (C:\projects\assignment-11\spice-warehouse-server\node_modules\express\lib\router\layer.js:95:5) at C:\projects\assignment-11\spice-warehouse-server\node_modules\express\lib\router\index.js:286:22 at param (C:\projects\assignment-11\spice-warehouse-server\node_modules\express\lib\router\index.js:367:14) [nodemon] app crashed - waiting for file changes before starting...
Your problem may be related to express.js related, so if this is your problem then you first turn off your server pressing by ctrl + c then turn it on again, then you go to your UI and hit reload then it will work properly.
Your ID is not being sent. You can try this way:
const query = { _id: ObjectId('yourid') };