Skip to content

Commit

Permalink
updates sort for feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
Pragades-Rajagopal committed Feb 7, 2024
1 parent 77f0d79 commit e8d87a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/Feeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = async (app) => {
FROM
feeds f
ORDER BY
created_on ASC
id ASC
LIMIT ${limit} OFFSET ${offset}
`;
} else if (sort && sort.toLowerCase() === 'asc') {
Expand All @@ -70,7 +70,7 @@ module.exports = async (app) => {
FROM
feeds f
ORDER BY
created_on ASC
id ASC
`;
} else if (limit && offset) {
sqlQuery = sql`
Expand All @@ -81,7 +81,7 @@ module.exports = async (app) => {
FROM
feeds f
ORDER BY
created_on DESC
id DESC
LIMIT ${limit} OFFSET ${offset}`;
} else {
sqlQuery = sql`
Expand All @@ -92,7 +92,7 @@ module.exports = async (app) => {
FROM
feeds f
ORDER BY
created_on DESC
id DESC
`;
}
const data = await db.query(sqlQuery);
Expand Down

0 comments on commit e8d87a9

Please sign in to comment.