While working on the upsert-geoms utility we noticed that the carto utility will return [undefined] objects if the query produces no results. This is problematic for error handling. We set up a workaround that created nulls in the format we were expecting instead (link below), but it would be great to refactor the carto utility to avoid this problem.
While working on the
upsert-geoms
utility we noticed that thecarto
utility will return [undefined] objects if the query produces no results. This is problematic for error handling. We set up a workaround that created nulls in the format we were expecting instead (link below), but it would be great to refactor thecarto
utility to avoid this problem.https://github.com/NYCPlanning/labs-zap-api/blob/develop/utils/upsert-geoms.js#L64