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

REST API - Filter by non existant tag returns all records #4792

Open
3 tasks done
sinag opened this issue Apr 17, 2024 · 2 comments
Open
3 tasks done

REST API - Filter by non existant tag returns all records #4792

sinag opened this issue Apr 17, 2024 · 2 comments

Comments

@sinag
Copy link

sinag commented Apr 17, 2024

Describe the issue

We are planning to use tag field to integrate kimai records to another systems records.
I am not sure if the original behaviour, when tag does not exist return all rows is meaningfull for other scenarios but generally when you filter for something which does not exist you expect to see zero records.

Is there a workaround for this?

I already tried

Kimai version

2.15.0

How do you run Kimai?

Docker

Which PHP version are you using?

Unknown

Logfile

No response

Screenshots

No response

@sinag sinag added the bug label Apr 17, 2024
@sinag
Copy link
Author

sinag commented Apr 17, 2024

Let me give you more details on my usage scenario;

  1. user opens a record on external system with record.id = 1
  2. external system is configured to show current record's related kimai timesheets
  3. external system queries kimai api with tags[]=1, if tag has not been created before, kimai returns all timesheets, expectation was to see no timesheets

@kevinpapst
Copy link
Member

kevinpapst commented Apr 17, 2024

when you filter for something which does not exist you expect to see zero records.

No. This behavior is unspecified. Kimai can't find a tag, so it queries without tag, which leads to all results. That's how tags currently work.

In the API it would be better if there was a validation, in that case your result would be a Bad request.

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

No branches or pull requests

2 participants