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

Query in fetchEntries() won't work in SvelteKit #3370

Open
Conceptiks opened this issue Jun 28, 2024 · 0 comments
Open

Query in fetchEntries() won't work in SvelteKit #3370

Conceptiks opened this issue Jun 28, 2024 · 0 comments
Assignees

Comments

@Conceptiks
Copy link

Describe the bug
A couple of weeks ago, we noticed that when using the SvelteSDK above 1.0.26, we would run into issues with our query passed to fetchEntries.

To Reproduce
Steps to reproduce the behavior:

  1. Create a data model in builder.io and assign start and end dates to schedule the data entry for expiry. Make sure it is currently live.
  2. Fetch this data model in SvelteKit using the fetchEntries function. Pass the following query to fetch all currently live entries as well as all entries where no startDate and no endDate have been set:
$or: [
                {
                    $and: [{ startDate: { $lte: Date.now() } }, { endDate: { $gte: Date.now() } }],
                },
                {
                    $and: [{ startDate: { $exists: false } }, { endDate: { $exists: false } }],
                },
            ],
  1. fetchEntries will return an empty array.

Expected behavior
fetchEntries should return currently live entries.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
I suspect this has something to do with the changes: #3007

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

3 participants