Skip to content

Commit

Permalink
Update Condition for password
Browse files Browse the repository at this point in the history
  • Loading branch information
pphatdev committed Apr 6, 2024
1 parent 58a1712 commit 8ad6650
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/models/password.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ export const getData = async ( request ) =>
},
})

const condition = id ? `where id = ${id}` : pagination
return await client.query(
`SELECT id, name, password from public.users ${ id ? `where id = ${id}` : pagination } `
`SELECT id, name, password from public.users $1`, [condition]
).then(
async result => {
const data = {
Expand Down

0 comments on commit 8ad6650

Please sign in to comment.