Fix: ピン留め投稿の表示順がおかしい (#4906)

* Fix: syuilo#4904

* fix comment
This commit is contained in:
MeiMei
2019-05-12 09:37:00 +09:00
committed by syuilo
parent 24c6dff3e4
commit 410b9ad6bc
3 changed files with 15 additions and 3 deletions

View File

@ -21,7 +21,10 @@ export default async (ctx: Router.IRouterContext) => {
return;
}
const pinings = await UserNotePinings.find({ userId: user.id });
const pinings = await UserNotePinings.find({
where: { userId: user.id },
order: { id: 'DESC' }
});
const pinnedNotes = await Promise.all(pinings.map(pining =>
Notes.findOne(pining.noteId).then(ensure)));