File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ const fetchStocks = async (req, res) => {
29
29
try {
30
30
const allStock = await stocks . fetchStocks ( )
31
31
return res . json ( {
32
- message : 'Stocks returned successfully!' ,
32
+ message : allStock . length > 0 ? 'Stocks returned successfully!' : 'No stocks found ',
33
33
stock : allStock . length > 0 ? allStock : [ ]
34
34
} )
35
35
} catch ( err ) {
@@ -48,7 +48,7 @@ const getSelfStocks = async (req, res) => {
48
48
const { id : userId } = req . userData
49
49
const userStocks = await stocks . fetchUserStocks ( userId )
50
50
return res . json ( {
51
- message : 'User stocks returned successfully!' ,
51
+ message : userStocks . length > 0 ? 'User stocks returned successfully!' : 'No stocks found ',
52
52
userStocks
53
53
} )
54
54
} catch ( err ) {
You can’t perform that action at this time.
0 commit comments