fix: ignore system user in users query & add full name to user in install route

This commit is contained in:
Jordan Knott
2020-07-16 21:57:02 -05:00
parent 45a92636cb
commit d3f29134e0
3 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@
SELECT * FROM user_account WHERE user_id = $1;
-- name: GetAllUserAccounts :many
SELECT * FROM user_account;
SELECT * FROM user_account WHERE username != 'system';
-- name: GetUserAccountByUsername :one
SELECT * FROM user_account WHERE username = $1;

View File

@ -62,7 +62,7 @@ func (q *Queries) DeleteUserAccountByID(ctx context.Context, userID uuid.UUID) e
}
const getAllUserAccounts = `-- name: GetAllUserAccounts :many
SELECT user_id, created_at, email, username, password_hash, profile_bg_color, full_name, initials, profile_avatar_url, role_code FROM user_account
SELECT user_id, created_at, email, username, password_hash, profile_bg_color, full_name, initials, profile_avatar_url, role_code FROM user_account WHERE username != 'system'
`
func (q *Queries) GetAllUserAccounts(ctx context.Context) ([]UserAccount, error) {