Skip to content

Commit 9637ad5

Browse files
committed
more data Transaction
1 parent 58e9817 commit 9637ad5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/services/crud-database/user.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,16 @@ const getListOfSharkFollowed = async (userId) => {
284284
if (!(await checkExistedUserId(userId)))
285285
return { message: "user-notfound" };
286286

287-
const users = await InvestorModel.find({ followers: userId }).select(
288-
"sharkId totalAssets percent24h transactionsHistory walletAddress -_id"
287+
const projection = {
288+
sharkId: 1,
289+
totalAssets: 1,
290+
percent24h: 1,
291+
walletAddress: 1
292+
};
293+
294+
const users = await InvestorModel.find(
295+
{ followers: { $in: [userId] } },
296+
projection
289297
);
290298

291299
return { message: "success", datas: users || [] };
@@ -316,7 +324,6 @@ const getTransactionsOfAllSharks = async (page, valueFilter = 0) => {
316324

317325
const transactions = await TransactionModel.aggregate([
318326
{
319-
320327
$project: {
321328
_id: 0,
322329
walletAddress: 1,

0 commit comments

Comments
 (0)