chore: Fixed the typo in ProfilePirctureURL attr (#3307)

This commit is contained in:
Chandan Jhunjhunwal 2023-08-12 10:10:25 +05:30 committed by GitHub
parent 233589b867
commit 03220fcf11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 37 deletions

View File

@ -1935,18 +1935,18 @@ func (aH *APIHandler) editUser(w http.ResponseWriter, r *http.Request) {
if len(update.Name) > 0 { if len(update.Name) > 0 {
old.Name = update.Name old.Name = update.Name
} }
if len(update.ProfilePirctureURL) > 0 { if len(update.ProfilePictureURL) > 0 {
old.ProfilePirctureURL = update.ProfilePirctureURL old.ProfilePictureURL = update.ProfilePictureURL
} }
_, apiErr = dao.DB().EditUser(ctx, &model.User{ _, apiErr = dao.DB().EditUser(ctx, &model.User{
Id: old.Id, Id: old.Id,
Name: old.Name, Name: old.Name,
OrgId: old.OrgId, OrgId: old.OrgId,
Email: old.Email, Email: old.Email,
Password: old.Password, Password: old.Password,
CreatedAt: old.CreatedAt, CreatedAt: old.CreatedAt,
ProfilePirctureURL: old.ProfilePirctureURL, ProfilePictureURL: old.ProfilePictureURL,
}) })
if apiErr != nil { if apiErr != nil {
RespondError(w, apiErr, nil) RespondError(w, apiErr, nil)

View File

@ -250,14 +250,14 @@ func RegisterFirstUser(ctx context.Context, req *RegisterRequest) (*model.User,
} }
user := &model.User{ user := &model.User{
Id: uuid.NewString(), Id: uuid.NewString(),
Name: req.Name, Name: req.Name,
Email: req.Email, Email: req.Email,
Password: hash, Password: hash,
CreatedAt: time.Now().Unix(), CreatedAt: time.Now().Unix(),
ProfilePirctureURL: "", // Currently unused ProfilePictureURL: "", // Currently unused
GroupId: group.Id, GroupId: group.Id,
OrgId: org.Id, OrgId: org.Id,
} }
return dao.DB().CreateUser(ctx, user, true) return dao.DB().CreateUser(ctx, user, true)
@ -328,14 +328,14 @@ func RegisterInvitedUser(ctx context.Context, req *RegisterRequest, nopassword b
} }
user := &model.User{ user := &model.User{
Id: uuid.NewString(), Id: uuid.NewString(),
Name: req.Name, Name: req.Name,
Email: req.Email, Email: req.Email,
Password: hash, Password: hash,
CreatedAt: time.Now().Unix(), CreatedAt: time.Now().Unix(),
ProfilePirctureURL: "", // Currently unused ProfilePictureURL: "", // Currently unused
GroupId: group.Id, GroupId: group.Id,
OrgId: invite.OrgId, OrgId: invite.OrgId,
} }
// TODO(Ahsan): Ideally create user and delete invitation should happen in a txn. // TODO(Ahsan): Ideally create user and delete invitation should happen in a txn.

View File

@ -185,7 +185,7 @@ func (mds *ModelDaoSqlite) CreateUser(ctx context.Context,
`INSERT INTO users (id, name, email, password, created_at, profile_picture_url, group_id, org_id) `INSERT INTO users (id, name, email, password, created_at, profile_picture_url, group_id, org_id)
VALUES (?, ?, ?, ?, ?, ?, ?,?);`, VALUES (?, ?, ?, ?, ?, ?, ?,?);`,
user.Id, user.Name, user.Email, user.Password, user.CreatedAt, user.Id, user.Name, user.Email, user.Password, user.CreatedAt,
user.ProfilePirctureURL, user.GroupId, user.OrgId, user.ProfilePictureURL, user.GroupId, user.OrgId,
) )
if err != nil { if err != nil {
@ -275,13 +275,13 @@ func (mds *ModelDaoSqlite) GetUser(ctx context.Context,
u.group_id, u.group_id,
g.name as role, g.name as role,
o.name as organization, o.name as organization,
COALESCE((select uf.flags COALESCE((select uf.flags
from user_flags uf from user_flags uf
where u.id = uf.user_id), '') as flags where u.id = uf.user_id), '') as flags
from users u, groups g, organizations o from users u, groups g, organizations o
where where
g.id=u.group_id and g.id=u.group_id and
o.id = u.org_id and o.id = u.org_id and
u.id=?;` u.id=?;`
if err := mds.db.Select(&users, query, id); err != nil { if err := mds.db.Select(&users, query, id); err != nil {

View File

@ -26,14 +26,14 @@ type InvitationObject struct {
} }
type User struct { type User struct {
Id string `json:"id" db:"id"` Id string `json:"id" db:"id"`
Name string `json:"name" db:"name"` Name string `json:"name" db:"name"`
Email string `json:"email" db:"email"` Email string `json:"email" db:"email"`
Password string `json:"password,omitempty" db:"password"` Password string `json:"password,omitempty" db:"password"`
CreatedAt int64 `json:"createdAt" db:"created_at"` CreatedAt int64 `json:"createdAt" db:"created_at"`
ProfilePirctureURL string `json:"profilePictureURL" db:"profile_picture_url"` ProfilePictureURL string `json:"profilePictureURL" db:"profile_picture_url"`
OrgId string `json:"orgId,omitempty" db:"org_id"` OrgId string `json:"orgId,omitempty" db:"org_id"`
GroupId string `json:"groupId,omitempty" db:"group_id"` GroupId string `json:"groupId,omitempty" db:"group_id"`
} }
type ApdexSettings struct { type ApdexSettings struct {