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

/lists/NUM returns all lists rather than one by ID #2117

Closed
mikeckennedy opened this issue Oct 29, 2024 · 3 comments
Closed

/lists/NUM returns all lists rather than one by ID #2117

mikeckennedy opened this issue Oct 29, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@mikeckennedy
Copy link

mikeckennedy commented Oct 29, 2024

Version:

  • listmonk: 4.0.1
  • OS: macOS

Description of the bug and steps to reproduce:

Doing a GET request against the URL: https://servername/api/lists/5 returns JSON of this style:

{
    "data": {
        "results": [
            {
                "id": 9,
                "uuid": "7a998..."
            },
            {
                "id": 8,
                "uuid": "a12603..."
            },
            {
                "id": 7,
                "uuid": "a12603..."
            },

            {
                "id": 6,
                "uuid": "a12603..."
            },

That is, all of the lists are returned when calling the endpoint at /lists/NUM (in this case I passed 5). It seems like something is wrong with the URL route here and it's being handled in the /lists route, not /lists/{int} route.

@mikeckennedy mikeckennedy added the bug Something isn't working label Oct 29, 2024
@mikeckennedy
Copy link
Author

Hey @knadh this is the bug I mentioned when closing #2111.

@knadh knadh closed this as completed in cf7d664 Oct 29, 2024
@knadh
Copy link
Owner

knadh commented Oct 29, 2024

Ouch, this was indeed a (tiny, but problematic) bug that crept through while building the new per-list permission system. I think I'll have to make a v4.0.2 release after waiting for the next couple of days in case any more reports come.

@mikeckennedy
Copy link
Author

Perfect, thanks a bunch. It's not a massive issue for my library ( https://github.com/mikeckennedy/listmonk ) because I added some logic to pull the details from the list if it returns a list instead. But it is an issue with a broken API. Happy to have it fixed in the next release.

Thanks for the great app.

ai-armageddon pushed a commit to Twitter-outreach/ListMonk that referenced this issue Mar 11, 2025
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