Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgres: Delete request by params value doesn't work wheras the get request by params works? #681

Closed
AKMuharrami opened this issue May 18, 2024 · 1 comment

Comments

@AKMuharrami
Copy link

code:

#works
router.get('/user:id', async (req, res) => {
const { id } = req.params;
const user = await sqlSELECT * FROM users WHERE ${id} = id

res.json(user);
});

#doesn't work
router.delete('/user:id', async (req, res) => {
const { id } = req.params;
const userd = await sqlDELETE FROM users WHERE ${id} = id
res.json(userd)
res.sendStatus(200);
});

@AKMuharrami
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant