id type change

This commit is contained in:
nquidox 2026-03-06 19:07:33 +03:00
parent 520f0e6ec7
commit 11ff61f561
3 changed files with 7 additions and 7 deletions

View file

@ -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