diff --git a/cmd/server/main.go b/cmd/server/main.go index 790c30f..d5310fa 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -59,6 +59,7 @@ func main() { config.Database.Name, config.Database.Port))) case "sqlite": + fallthrough default: db, _ = gorm.Open(sqlite.Open(config.Database.File), &gorm.Config{}) } diff --git a/server/server.go b/server/server.go index 0eafcf2..c12456f 100644 --- a/server/server.go +++ b/server/server.go @@ -270,7 +270,7 @@ func (m *usersServer) SetRoles(ctx context.Context, in *proto.SetRolesRequest) ( var r models.Role for _, x := range in.Roles { if tx := m.db.First(&r, "id = ?", x.Id); tx.RowsAffected != 0 { - u.Roles = append(u.Roles, r) + u.Roles = append(u.Roles, &r) } }