fixing pagination
This commit is contained in:
@@ -37,7 +37,7 @@ const getAllSubSectionsDb = async (searchParams = {}) => {
|
||||
${whereConditions.length > 0 ? ` AND ${whereConditions.join(" AND ")}` : ""}
|
||||
${whereOrConditions ? whereOrConditions : ""}
|
||||
ORDER BY a.sub_section_id ASC
|
||||
${searchParams.limit ? `OFFSET $2 ROWS FETCH NEXT $1 ROWS ONLY` : ""};
|
||||
${searchParams.limit ? `OFFSET $2 * $1 ROWS FETCH NEXT $1 ROWS ONLY` : ''}
|
||||
`;
|
||||
|
||||
const result = await pool.query(queryText, queryParams);
|
||||
|
||||
Reference in New Issue
Block a user