Skip to content

Commit

Permalink
prevent null pfp error
Browse files Browse the repository at this point in the history
  • Loading branch information
ddusichka committed Dec 5, 2024
1 parent 5301460 commit 3380de3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/internal/storage/postgres/schema/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (r *UserRepository) CalculateScore(ctx context.Context, id uuid.UUID) (int,
}

func (r *UserRepository) CreateUser(ctx context.Context, user models.User) (models.User, error) {
if err := r.db.QueryRow(ctx, `INSERT INTO "user" (id, username, display_name, email) VALUES ($1, $2, $3, $4) RETURNING id`, user.ID, user.Username, user.DisplayName, user.Email).Scan(&user.ID); err != nil {
if err := r.db.QueryRow(ctx, `INSERT INTO "user" (id, username, display_name, email, profile_picture) VALUES ($1, $2, $3, $4, 'https://www.pngitem.com/pimgs/m/146-1468843_profile-icon-orange-png-transparent-png.png') RETURNING id`, user.ID, user.Username, user.DisplayName, user.Email).Scan(&user.ID); err != nil {
return models.User{}, err
}

Expand Down

0 comments on commit 3380de3

Please sign in to comment.