mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-16 23:17:33 -07:00
Refactor
This commit is contained in:
parent
f03f03dcc0
commit
77cc11d8a0
1 changed files with 2 additions and 5 deletions
|
@ -43,7 +43,6 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
|
||||||
return rej('cannot set sinceId and untilId');
|
return rej('cannot set sinceId and untilId');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct query
|
|
||||||
const query = {
|
const query = {
|
||||||
deletedAt: null,
|
deletedAt: null,
|
||||||
|
|
||||||
|
@ -81,15 +80,13 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Issue query
|
|
||||||
const mentions = await Note
|
const mentions = await Note
|
||||||
.find(query, {
|
.find(query, {
|
||||||
limit: ps.limit,
|
limit: ps.limit,
|
||||||
sort: sort
|
sort: sort
|
||||||
});
|
});
|
||||||
|
|
||||||
mentions.forEach(note => read(user._id, note._id));
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
res(await packMany(mentions, user));
|
res(await packMany(mentions, user));
|
||||||
|
|
||||||
|
mentions.forEach(note => read(user._id, note._id));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue