@trudb/tru-common-lib 0.0.383 → 0.0.384

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1412,11 +1412,13 @@ class TruEntityAccessor {
1412
1412
  query = setupQuery(query);
1413
1413
  return this._entityManager.executeQueryLocally(query);
1414
1414
  };
1415
- this.searchQueryChoices = (entity, setupQuery = null, hid = null, goToServer = false) => {
1415
+ this.searchQueryChoices = (entity, setupQuery = null, hid = null, goToServer = false, ref = undefined) => {
1416
1416
  const pkeyName = entity.name + 'Ref';
1417
1417
  let query = this._breezeContext.createQuery(this.getQueryServiceName(entity));
1418
1418
  if (setupQuery)
1419
1419
  query = setupQuery(query) ?? query;
1420
+ if (ref)
1421
+ query = query.where(entity.name + 'Ref', '==', ref);
1420
1422
  if (goToServer) {
1421
1423
  return defer(() => from(this._entityManager.executeQuery(query).then((queryData) => {
1422
1424
  return this.formatQueryChoices(query, queryData.results, pkeyName, null);