fixing pagination

This commit is contained in:
2025-10-21 20:05:15 +07:00
parent a9ad9cccc7
commit 9c08e51d31
11 changed files with 11 additions and 11 deletions

View File

@@ -36,7 +36,7 @@ const getAllShiftDb = async (searchParams = {}) => {
${whereConditions.length > 0 ? ` AND ${whereConditions.join(" AND ")}` : ""}
${whereOrConditions ? ` ${whereOrConditions}` : ""}
ORDER BY a.shift_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);