mirror of
https://github.com/pushbits/server.git
synced 2025-05-24 14:26:35 +02:00
Implement deletion of users
This commit is contained in:
parent
18d11677ac
commit
f6ca287d0b
10 changed files with 112 additions and 35 deletions
|
@ -78,8 +78,9 @@ func (d *Database) Close() {
|
|||
|
||||
// Populate fills the database with initial information like the admin user.
|
||||
func (d *Database) Populate(name, password, matrixID string) error {
|
||||
user := new(model.User)
|
||||
query := d.gormdb.Where("name = ?", name).First(user)
|
||||
var user model.User
|
||||
|
||||
query := d.gormdb.Where("name = ?", name).First(&user)
|
||||
|
||||
if errors.Is(query.Error, gorm.ErrRecordNotFound) {
|
||||
user := model.NewUser(name, password, true, matrixID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue