Add creat user in database
This commit is contained in:
1 parent
25fcffc259
commit
88ae5fa188
3 files changed
+22
-19
No files matched your search
@@ -13,8 +13,8 @@ type Userrepo struct {
|
||||
|
||||
func (u *Userrepo) Create(user *model.User) (*model.User, error) {
|
||||
err := u.db.db.QueryRow(context.Background(),
|
||||
"INSERT INTO users (id, login, email, password, avatar_url, token, permissionLVL) VALUES($1, $2, $3, $4, $5, $6, $7)").
|
||||
Scan(user.Id, user.Login, user.Email, user.Password, user.Avatar_Url, user.Token, user.PermisionLVL)
|
||||
"INSERT INTO users (id, login, email, password, avatar_url, token, permisionlvl) VALUES($1, $2, $3, $4, $5, $6, $7) RETURNING id, permisionlvl", user.Id, user.Login, user.Email, user.Password, user.Avatar_Url, user.Token, user.PermisionLVL).
|
||||
Scan(&user.Id, &user.PermisionLVL)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user