feat: profile bio

This commit is contained in:
Krispire Admin
2026-08-07 23:47:03 +05:30
parent afcdd7ef19
commit 623935df22
8 changed files with 55 additions and 9 deletions
+4 -2
View File
@@ -38,7 +38,7 @@ const userColumns = `id, email, handle, password_hash, name, avatar_url, role, p
sampradaya, gender, initiated, initiated_at, daily_chanting_rounds,
preferred_chanting_time, peak_active_time, banned_at,
bookmark_limit, public_collection_limit, private_collection_limit,
disciple_id`
disciple_id, bio`
// rowScanner is satisfied by both pgx.Row (QueryRow) and pgx.Rows, so
// scanUser works for single-row and iterated reads alike.
@@ -54,7 +54,7 @@ func scanUser(row rowScanner, u *model.User) error {
&u.Sampradaya, &u.Gender, &u.Initiated, &u.InitiatedAt, &u.DailyChantingRounds,
&u.PreferredChantingTime, &u.PeakActiveTime, &u.BannedAt,
&u.BookmarkLimit, &u.PublicCollectionLimit, &u.PrivateCollectionLimit,
&u.DiscipleID,
&u.DiscipleID, &u.Bio,
)
}
@@ -66,6 +66,7 @@ type ProfileUpdate struct {
Name *string
AvatarURL *string
Handle *string
Bio *string // nil=leave, ""=clear, text=set
Country *string
Sampradaya *string // nil=leave, ""=clear, code=set
Gender *string
@@ -232,6 +233,7 @@ func (r *UserRepo) UpdateProfile(ctx context.Context, id string, p ProfileUpdate
set("handle", *p.Handle)
}
nullableString("avatar_url", p.AvatarURL)
nullableString("bio", p.Bio)
nullableString("country", p.Country)
nullableString("sampradaya", p.Sampradaya)
nullableString("gender", p.Gender)