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

Deleting an nonexistent certificate request returns 202 Accepted message #192

Open
gruyaume opened this issue Feb 25, 2025 · 1 comment
Open
Labels
bug Something isn't working

Comments

@gruyaume
Copy link
Collaborator

Describe the bug

Whenever we delete a non-existent certificate request (and perhaps other items) using the HTTP API, we get a 202 Accepted return message.

To Reproduce

  1. Create Account
  2. Login
  3. Delete Certificate Request

Expected behavior

Here we would expect a 404 as the endpoint doesn't exist.

Logs

Request

curl --location --request DELETE 'https://127.0.0.1:3000/api/v1/certificate_requests/4' \
--header 'Authorization: ••••••' \
--data ''

Response:

{
    "result": {
        "message": "success"
    }
}

Environment

@gruyaume gruyaume added the bug Something isn't working label Feb 25, 2025
@kayra1
Copy link
Contributor

kayra1 commented Feb 25, 2025

If we delete a nonexistent certificate wouldn't the expected result still be the same :D.

But yes this is because SQL doesn't return anything if no rows matching the query were effected on delete or update operations, we will have to manually check beforehand if we want to differentiate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants