Fix unknown oauth user display
This commit is contained in:
parent
91e3050235
commit
08cda89609
@ -365,12 +365,12 @@ app.get('/api/cities/:cityName/stations', (req, res) => {
|
|||||||
const query = `
|
const query = `
|
||||||
SELECT
|
SELECT
|
||||||
ws.*,
|
ws.*,
|
||||||
u.username as created_by_name,
|
COALESCE(u.display_name, u.username) as created_by_name,
|
||||||
su.description as latest_description,
|
su.description as latest_description,
|
||||||
su.last_refill_time,
|
su.last_refill_time,
|
||||||
su.estimated_empty_time,
|
su.estimated_empty_time,
|
||||||
su.updated_at as last_updated,
|
su.updated_at as last_updated,
|
||||||
u2.username as updated_by_name,
|
COALESCE(u2.display_name, u2.username) as updated_by_name,
|
||||||
c.display_name as city_name
|
c.display_name as city_name
|
||||||
FROM water_stations ws
|
FROM water_stations ws
|
||||||
JOIN cities c ON ws.city_id = c.id
|
JOIN cities c ON ws.city_id = c.id
|
||||||
@ -417,12 +417,12 @@ app.get('/api/stations', (req, res) => {
|
|||||||
const query = `
|
const query = `
|
||||||
SELECT
|
SELECT
|
||||||
ws.*,
|
ws.*,
|
||||||
u.username as created_by_name,
|
COALESCE(u.display_name, u.username) as created_by_name,
|
||||||
su.description as latest_description,
|
su.description as latest_description,
|
||||||
su.last_refill_time,
|
su.last_refill_time,
|
||||||
su.estimated_empty_time,
|
su.estimated_empty_time,
|
||||||
su.updated_at as last_updated,
|
su.updated_at as last_updated,
|
||||||
u2.username as updated_by_name
|
COALESCE(u2.display_name, u2.username) as updated_by_name
|
||||||
FROM water_stations ws
|
FROM water_stations ws
|
||||||
LEFT JOIN users u ON ws.created_by = u.id
|
LEFT JOIN users u ON ws.created_by = u.id
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user