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

Fix getFiles query logic to prevent duplicate records #512

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

m7moudabdel7mid
Copy link
Contributor

This pull request fixes an issue in the getFiles method where the query logic caused duplicate file records due to improper condition grouping.

Before the Change
The query structure was:
select * from `media` where `id` not in (?, ?) and `type` in (?) or `type` LIKE ? order by `created_at` desc

After the Change
The query structure is now:
select * from `media` where `id` not in (?, ?) and (`type` in (?) or `type` LIKE ?) order by `created_at` desc

This ensures all conditions are properly applied, preventing duplicates.

@awcodes awcodes merged commit 6fd71cf into awcodes:3.x Jul 26, 2024
3 checks passed
@awcodes
Copy link
Owner

awcodes commented Jul 26, 2024

Good catch. Thank you.

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

Successfully merging this pull request may close these issues.

2 participants