Greenstand / treetracker-admin-api

Legacy API microservice for the admin panel
GNU Affero General Public License v3.0
31 stars 80 forks source link

v2 grower does not show location or registered at date #624

Closed ZavenArra closed 2 years ago

ZavenArra commented 2 years ago

data exists for this user, but no country or registration date shows

id  | planter_id | device_id | first_name | last_name | organization |  phone   | email | location_string | device_identifier |         created_at         |        lat         |        lon         | gps_accuracy |                        geom
------+------------+-----------+------------+-----------+--------------+----------+-------+-----------------+-------------------+----------------------------+--------------------+--------------------+--------------+----------------------------------------------------
 9540 |       5601 |           | nelson     | kerbyson  |              | 47419183 |       |                 |                   | 2022-03-10 17:35:05.065644 | 18.282481133937836 | -73.58143050223589 |              | 0101000020E610000000004828366552C0000000AF50483240
(1 row)

@Nick - Admin Panel Lead here is the data for that planter, as you can see it IS populated. Visiting the link you posted just gives me an error: {} and API logs show

Expected constructor: Object
Received value has no prototype
Received value: undefined
at isAuth (/app/dist/js/auth.js:410:46)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
at /app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
at next (/app/node_modules/express/lib/router/index.js:275:10)
at /app/node_modules/body-parser/lib/read.js:130:5
at invokeCallback (/app/node_modules/raw-body/index.js:224:16)
at done (/app/node_modules/raw-body/index.js:213:7)
at IncomingMessage.onEnd (/app/node_modules/raw-body/index.js:273:7)
at IncomingMessage.emit (events.js:314:20)
at endReadableNT (_stream_readable.js:1223:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
matcherResult: { message: [Function], pass: false }
}
nmcharlton commented 2 years ago

We don't handle empty device_identifier properly; we run an inner join to device info instead of a left join.

ZavenArra commented 2 years ago

got it. can we update this to left join?

see https://github.com/Greenstand/treetracker-admin-client/issues/487 for the complete solution.

nmcharlton commented 2 years ago

Resolved by #625