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

Why does this query return empty list of models? #56

Closed
MilesAdamson opened this issue May 12, 2020 · 1 comment
Closed

Why does this query return empty list of models? #56

MilesAdamson opened this issue May 12, 2020 · 1 comment

Comments

@MilesAdamson
Copy link

The my api for getting jobs expects a date range. The query below successfully gets the jobs from REST. However, when I run the same query without internet, I receive an empty list of jobs.

    List<Job> jobs = await repository.get<Job>(
            query: Query(action: QueryAction.get, providerArgs: {
          "start": dateTime.toIso8601String(),
          "end": dateTime.add(Duration(days: 1)).toIso8601String()
        }));

If I comment that out and run this without internet, I receive all the jobs which are saved in Sqlite:

    List<Job> jobs = await repository.get<Job>();

Why am I receiving an empty list of jobs from the first query? How can I change it to return all jobs which are saved in the table?

@MilesAdamson
Copy link
Author

Turns out I can't read docs and should be using where for this, not providerArgs

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant