diff --git a/lib/models/observation_preload.js b/lib/models/observation_preload.js index bbebf330..23f758aa 100644 --- a/lib/models/observation_preload.js +++ b/lib/models/observation_preload.js @@ -153,7 +153,7 @@ const ObservationPreload = class ObservationPreload { .field( "observation_photos.uuid" ) .from( "observation_photos" ) .where( "observation_id IN ?", obsIDs ); - const { rows } = await pgClient.replica.query( query.toString( ) ); + const { rows } = await pgClient.query( query.toString( ) ); const observationPhotos = { }; _.each( rows, r => { observationPhotos[r.id] = { @@ -196,7 +196,7 @@ const ObservationPreload = class ObservationPreload { .left_join( "file_prefixes", null, "photos.file_prefix_id = file_prefixes.id" ) .left_join( "file_extensions", null, "photos.file_extension_id = file_extensions.id" ) .where( "photos.id IN ?", photoIDs ); - const { rows } = await pgClient.replica.query( query.toString( ) ); + const { rows } = await pgClient.query( query.toString( ) ); _.each( rows, r => { const photo = { id: r.id, @@ -414,7 +414,7 @@ const ObservationPreload = class ObservationPreload { .left_join( "preferences", null, "project_observations.id = preferences.owner_id " + "AND preferences.owner_type='ProjectObservation' AND preferences.name='curator_coordinate_access'" ) .where( "observation_id IN ?", obsIDs ); - const result = await pgClient.replica.query( query.toString( ) ); + const result = await pgClient.query( query.toString( ) ); const projectObs = { }; _.each( result.rows, r => { projectObs[r.observation_id] = projectObs[r.observation_id] || []; @@ -442,7 +442,7 @@ const ObservationPreload = class ObservationPreload { const query = squel.select( ).fields( ["id", "observation_id"] ) .from( "identifications" ) .where( "observation_id IN ?", obsIDs ); - const { rows } = await pgClient.replica.query( query.toString( ) ); + const { rows } = await pgClient.query( query.toString( ) ); const obsIdentifications = { }; _.each( rows, r => { obsIdentifications[r.observation_id] = obsIdentifications[r.observation_id] || [];