feat(db): add timezone column to GetUser query
The GetUser query did not select the timezone column, so the router helper could not access userDB.Timezone. Added u.timezone to the SELECT list so the per-user timezone is available in the template user context.
This commit is contained in:
@@ -5662,6 +5662,7 @@ SELECT
|
||||
u.max_devices,
|
||||
u.created_at,
|
||||
u.updated_at,
|
||||
u.timezone,
|
||||
(SELECT COUNT(*) FROM devices WHERE user_id = u.id) as device_count
|
||||
FROM users u
|
||||
WHERE u.id = $1
|
||||
@@ -5678,6 +5679,7 @@ type GetUserRow struct {
|
||||
MaxDevices pgtype.Int4 `db:"max_devices" json:"max_devices"`
|
||||
CreatedAt pgtype.Timestamptz `db:"created_at" json:"created_at"`
|
||||
UpdatedAt pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
|
||||
Timezone pgtype.Text `db:"timezone" json:"timezone"`
|
||||
DeviceCount int64 `db:"device_count" json:"device_count"`
|
||||
}
|
||||
|
||||
@@ -5695,6 +5697,7 @@ func (q *Queries) GetUser(ctx context.Context, id pgtype.UUID) (GetUserRow, erro
|
||||
&i.MaxDevices,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.Timezone,
|
||||
&i.DeviceCount,
|
||||
)
|
||||
return i, err
|
||||
|
||||
Reference in New Issue
Block a user