Skip to content

Commit

Permalink
restored and removed distinct on units.id. This affects order of the …
Browse files Browse the repository at this point in the history
…response, which breaks other endpoints. May need to reconsider adding the group by clause back in
  • Loading branch information
amyfromandi committed Oct 9, 2024
1 parent c5cb252 commit c142468
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions v2/units.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ module.exports = function (req, res, next, cb) {
: "lookup_unit_attrs_api.measure_short";

var columnList = `
DISTINCT ON (units.id)
units.id AS unit_id,
units_sections.section_id AS section_id,
units_sections.col_id AS col_id,
Expand Down Expand Up @@ -582,11 +581,10 @@ module.exports = function (req, res, next, cb) {
LEFT JOIN macrostrat.lookup_strat_names ON lookup_strat_names.strat_name_id=unit_strat_names.strat_name_id
LEFT JOIN macrostrat.unit_notes ON unit_notes.unit_id=units.id
WHERE ${where}
ORDER BY ${orderby.length > 0 ? orderby.join(", ") + "," : ""} units.id, lookup_units.t_age ASC
ORDER BY ${orderby.length > 0 ? orderby.join(", ") + "," : ""} lookup_units.t_age ASC
${limit}`;

larkin.queryPg("burwell", sql, params, function (error, result) {
console.log(result)
if (error) {
console.log(error);
callback(error);
Expand Down

0 comments on commit c142468

Please sign in to comment.