Skip to content

Commit

Permalink
fx<Xjobs>:fix sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy-py committed Dec 4, 2024
1 parent 56cf5f7 commit 0480689
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions jobsfeed/xjob.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ exports.getXjobs = async (req, res) => {

page = page ? +page : 0;
limit = limit ? +limit : 40;
// console.log(page, limit);

const data = await Xjob.paginate(
{},
{
page: page,
limit: limit
limit: limit,
sort: { createdAt: -1 }
}
).sort({ createdAt: -1 });
);

const jobs = data.docs;

Expand All @@ -42,6 +42,7 @@ exports.getXjobs = async (req, res) => {
nextPage: data.nextPage
});
} catch (error) {
console.log(error);
return res.status(500).json({
status: 'error',
message: 'An error occurred',
Expand Down

0 comments on commit 0480689

Please sign in to comment.