Compare commits
No commits in common. "master" and "v0.0.3" have entirely different histories.
5
rest.go
5
rest.go
|
@ -636,10 +636,9 @@ func ModelTypes(ctx context.Context, db *gorm.DB, model any, domainName, labelCo
|
||||||
tx := db.WithContext(ctx)
|
tx := db.WithContext(ctx)
|
||||||
result := make([]map[string]any, 0, 10)
|
result := make([]map[string]any, 0, 10)
|
||||||
if domainName == "" {
|
if domainName == "" {
|
||||||
tx.Model(model).Select(labelColumn, valueColumn).Scan(&result)
|
domainName = defaultDomain
|
||||||
} else {
|
|
||||||
tx.Model(model).Select(labelColumn, valueColumn).Where("domain=?", domainName).Scan(&result)
|
|
||||||
}
|
}
|
||||||
|
tx.Model(model).Select(labelColumn, valueColumn).Where("domain=?", domainName).Scan(&result)
|
||||||
values = make([]*types.TypeValue, 0, len(result))
|
values = make([]*types.TypeValue, 0, len(result))
|
||||||
for _, pairs := range result {
|
for _, pairs := range result {
|
||||||
feed := &types.TypeValue{}
|
feed := &types.TypeValue{}
|
||||||
|
|
Loading…
Reference in New Issue