diff --git a/server/endpoints/QueryEndpointHandler.ts b/server/endpoints/QueryEndpointHandler.ts index d8bc861..4707b32 100644 --- a/server/endpoints/QueryEndpointHandler.ts +++ b/server/endpoints/QueryEndpointHandler.ts @@ -177,9 +177,13 @@ function constructQuery(knex: Knex, queryFor: ObjectType, queryElem: api.QueryEl joinObjects.delete(queryFor); // We are already querying this object in the base query. // Figure out what data we want to select from the results. - var columns: any[] = []; - joinObjects.forEach((obj: ObjectType) => columns.push(...objectColumns[obj])); - columns.push(...objectColumns[queryFor]); + var columns: any[] = objectColumns[queryFor]; + + // TODO: there was a line here to add columns for the joined objects. + // Could not get it to work with Postgres, which wants aggregate functions + // to specify exactly how duplicates should be aggregated. + // Not sure whether we need these columns in the first place. + // joinObjects.forEach((obj: ObjectType) => columns.push(...objectColumns[obj])); // First, we create a base query for the type of object we need to yield. var q = knex.select(columns) diff --git a/server/test/test.sh b/server/test/test.sh index 4273e5f..b5c72f8 100755 --- a/server/test/test.sh +++ b/server/test/test.sh @@ -3,8 +3,6 @@ # Wrapper around the Jasmine test scripts. # Can test with different types of databases. -set -x - SCRIPT=`realpath $0` SCRIPTPATH=`dirname $SCRIPT` SOURCEPATH="$SCRIPTPATH/.."