File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ export function UtilsRepositoryMixin<
8080 const planterIds = await this . getNonOrganizationPlanterIds ( ) ;
8181 // if planter repository request
8282 if ( model === 'planter' ) {
83- return { id : { inq : planterIds } } ;
83+ return { planterId : { inq : planterIds } } ;
8484 } else {
8585 // if trees or other repository request
8686 return {
@@ -102,7 +102,7 @@ export function UtilsRepositoryMixin<
102102 return {
103103 or : [
104104 { organizationId : { inq : entityIds } } ,
105- { id : { inq : planterIds } } ,
105+ { planterId : { inq : planterIds } } ,
106106 ] ,
107107 } ;
108108 } else {
Original file line number Diff line number Diff line change @@ -50,13 +50,11 @@ export class PlanterRepository extends UtilsRepositoryMixin<
5050 if ( deviceIdentifier === null ) {
5151 return `LEFT JOIN planter_registrations
5252 ON planter.id=planter_registrations.planter_id
53- WHERE (planter_registrations.device_identifier ISNULL)
54- GROUP BY planter.id` ;
53+ WHERE (planter_registrations.device_identifier ISNULL)` ;
5554 }
5655 return `JOIN planter_registrations
5756 ON planter.id=planter_registrations.planter_id
58- WHERE (planter_registrations.device_identifier='${ deviceIdentifier } ')
59- GROUP BY planter.id` ;
57+ WHERE (planter_registrations.device_identifier='${ deviceIdentifier } ')` ;
6058 }
6159
6260 // default .find() wasn't applying the org filters
@@ -72,10 +70,9 @@ export class PlanterRepository extends UtilsRepositoryMixin<
7270
7371 try {
7472 if ( this . dataSource . connector ) {
75- const columnNames = this . dataSource . connector . buildColumnNames (
76- 'Planter' ,
77- filter ,
78- ) ;
73+ const columnNames = this . dataSource . connector
74+ . buildColumnNames ( 'Planter' , filter )
75+ . replace ( '"id"' , 'planter.id as "id"' ) ;
7976
8077 let selectStmt ;
8178 if ( deviceIdentifier ) {
You can’t perform that action at this time.
0 commit comments