Skip to content

Commit 1ccda9b

Browse files
committed
fix: lint warnings and logic for querying planters by organization
1 parent 3c544c4 commit 1ccda9b

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/mixins/utils.repository-mixin.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { MixinTarget } from '@loopback/core';
22
import { CrudRepository, Model } from '@loopback/repository';
33
import expect from 'expect-runtime';
4-
import { buildFilterQuery } from '../js/buildFilterQuery';
5-
import { utils } from '../js/utils';
64

5+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
76
export function UtilsRepositoryMixin<
87
M extends Model,
98
R extends MixinTarget<CrudRepository<M>>,
109
>(superClass: R) {
1110
return class extends superClass {
11+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1212
[x: string]: any;
1313
// put the shared code here
1414
async getEntityIdsByOrganizationId(
@@ -80,13 +80,11 @@ export function UtilsRepositoryMixin<
8080
const planterIds = await this.getNonOrganizationPlanterIds();
8181
// if planter repository request
8282
if (model === 'planter') {
83-
return {
84-
or: [{ organizationId: null }, { id: { inq: planterIds } }],
85-
};
83+
return { id: { inq: planterIds } };
8684
} else {
8785
// if trees or other repository request
8886
return {
89-
or: [
87+
and: [
9088
{ plantingOrganizationId: null },
9189
{ planterId: { inq: planterIds } },
9290
],

0 commit comments

Comments
 (0)