Skip to content

Commit

Permalink
ordena documentos por orden de cierre
Browse files Browse the repository at this point in the history
  • Loading branch information
xtian7489 committed Aug 25, 2023
1 parent d285730 commit 9f23a6f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ router.route('/')
auxOne++
}
let cantTotal = results.length
results.sort((a,b)=> new Date(b.currentVersion.content.closingDate) - new Date(a.currentVersion.content.closingDate) )
let finalArr = results.splice(((paginate.page - 1) * paginate.limit), paginate.limit)
res.status(status.OK).json({
results: finalArr,
Expand Down

0 comments on commit 9f23a6f

Please sign in to comment.