Open gracelungu opened 1 year ago
There seems to be a syntax error in the SQL query within the getItemsWithPagination
function. The LIMIT
and OFFSET
values aren't being interpolated correctly. Please revise this to make sure the query is executed correctly. The corrected query would look like this:
const items = await query(`SELECT * FROM items ORDER BY id LIMIT ${limit} OFFSET ${offset}`);
Also, please ensure the use of parameterized queries or prepared statements to prevent SQL injection attacks.
This PR adds pagination support to the list items endpoint.