Commit 80c11998 authored by COTONNEC's avatar COTONNEC
Browse files

[fix] fix base-entity-service watchAll when given query is used.

parent 9d077dfb
......@@ -180,7 +180,7 @@ export abstract class BaseEntityService<
const withTotal = (!opts || opts.withTotal !== false) && this.queries.loadAllWithTotal && true;
const query = (opts && opts.query) // use given query
// Or get loadAll or loadAllWithTotal query
|| withTotal ? this.queries.loadAllWithTotal : this.queries.loadAll;
|| (withTotal ? this.queries.loadAllWithTotal : this.queries.loadAll);
return this.mutableWatchQuery<LoadResult<any>>({
queryName: withTotal ? 'LoadAllWithTotal' : 'LoadAll',
query,
......@@ -237,7 +237,7 @@ export abstract class BaseEntityService<
const withTotal = (!opts || opts.withTotal !== false) && this.queries.loadAllWithTotal && true;
const query = (opts && opts.query) // use given query
// Or get loadAll or loadAllWithTotal query
|| withTotal ? this.queries.loadAllWithTotal : this.queries.loadAll;
|| (withTotal ? this.queries.loadAllWithTotal : this.queries.loadAll);
const {data, total} = await this.graphql.query<LoadResult<any>>({
query,
variables,
......
......@@ -282,7 +282,7 @@ export class EntityStore<
*/
async persist(opts?: { skipIfPristine?: boolean }): Promise<number> {
opts = {
skipIfPristine: true,
skipIfPristine: this.policy.skipNonLocalEntities,
...opts
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment