Skip to content

Commit 4f18f74

Browse files
committed
fix: add modelName to query to avoid ambiguous fields
1 parent d6db27b commit 4f18f74

2 files changed

Lines changed: 0 additions & 17 deletions

File tree

src/mixins/utils.repository-mixin.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,6 @@ export function UtilsRepositoryMixin<
8080
const planterIds = await this.getNonOrganizationPlanterIds();
8181
// if planter repository request
8282
if (model === 'planter') {
83-
// return {
84-
// and: [
85-
// { organizationId: null },
86-
// { 'planter.id': { inq: planterIds } },
87-
// ],
88-
// };
89-
// could just do this if we didn't need to use 'planter.id' to avoid errors with adding other filters
9083
return { id: { inq: planterIds } };
9184
} else {
9285
// if trees or other repository request

src/repositories/planter.repository.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { Planter, PlanterRelations, PlanterRegistration } from '../models';
1212
import { TreetrackerDataSource } from '../datasources';
1313
import { PlanterRegistrationRepository } from './planterRegistration.repository';
1414
import { UtilsRepositoryMixin } from '../mixins/utils.repository-mixin';
15-
// import expect from 'expect-runtime';
1615
import { buildFilterQuery } from '../js/buildFilterQuery';
1716
import { utils } from '../js/utils';
1817

@@ -70,15 +69,6 @@ export class PlanterRepository extends UtilsRepositoryMixin<
7069

7170
try {
7271
if (this.dataSource.connector) {
73-
// const columnNames = this.dataSource.connector
74-
// .buildColumnNames('Planter', filter)
75-
// .replace('"id"', 'planter.id as "id"')
76-
// .replace('"first_name"', 'planter.first_name as "first_name"')
77-
// .replace('"last_name"', 'planter.last_name as "last_name"')
78-
// .replace('"email"', 'planter.email as "email"')
79-
// .replace('"organization"', 'planter.organization as "organization"')
80-
// .replace('"phone"', 'planter.phone as "phone"');
81-
8272
let selectStmt;
8373
if (deviceIdentifier) {
8474
selectStmt = `SELECT planter.* FROM planter ${this.getPlanterRegistrationJoinClause(

0 commit comments

Comments
 (0)