id type change
This commit is contained in:
parent
520f0e6ec7
commit
11ff61f561
3 changed files with 7 additions and 7 deletions
|
|
@ -6,7 +6,7 @@ import (
|
|||
)
|
||||
|
||||
type Repository interface {
|
||||
getUserId(ctx context.Context, userUuid string) (string, error)
|
||||
getUserId(ctx context.Context, userUuid string) (int64, error)
|
||||
}
|
||||
|
||||
type repo struct {
|
||||
|
|
@ -19,13 +19,13 @@ func newRepository(db *pgxpool.Pool) Repository {
|
|||
}
|
||||
}
|
||||
|
||||
func (r *repo) getUserId(ctx context.Context, userUuid string) (string, error) {
|
||||
func (r *repo) getUserId(ctx context.Context, userUuid string) (int64, error) {
|
||||
q := `SELECT id FROM users WHERE uuid = $1 AND deleted_at IS NULL LIMIT 1`
|
||||
row := r.db.QueryRow(ctx, q, userUuid)
|
||||
|
||||
var id string
|
||||
var id int64
|
||||
if err := row.Scan(&id); err != nil {
|
||||
return "", err
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return id, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue