feat: add private and profile
This commit is contained in:
@@ -52,6 +52,14 @@ func (r *Repo) Create(ctx context.Context, mobile string) (*User, error) {
|
||||
return r.FindByID(ctx, id)
|
||||
}
|
||||
|
||||
// UpdateProfile نام نمایشی و آواتار کاربر را تنظیم میکند.
|
||||
func (r *Repo) UpdateProfile(ctx context.Context, id int64, firstName, avatar string) error {
|
||||
_, err := r.db.ExecContext(ctx,
|
||||
`UPDATE users SET first_name = ?, avatar = ? WHERE id = ?`,
|
||||
firstName, avatar, id)
|
||||
return err
|
||||
}
|
||||
|
||||
// FindOrCreate اگر کاربر نبود میسازد (مطابق فلوی login-otp).
|
||||
func (r *Repo) FindOrCreate(ctx context.Context, mobile string) (*User, error) {
|
||||
u, err := r.FindByMobile(ctx, mobile)
|
||||
|
||||
Reference in New Issue
Block a user