Skip to content
Snippets Groups Projects
Commit 014260e1 authored by Pavel Antonov's avatar Pavel Antonov :asterisk:
Browse files

Merge branch 'feature/PRXS-2838-SetupRuntimeConfig-Suppliment' into...

Merge branch 'feature/PRXS-2838-SetupRuntimeConfig-Suppliment' into 'feature/PRXS-2838-SetupRuntimeConfig'

Доработки нового Setup

See merge request perxis/perxis-go!329
parents fc59dbf3 e343ccc7
No related branches found
No related tags found
No related merge requests found
......@@ -141,6 +141,8 @@ func (s *Setup) InstallCollection(ctx context.Context, c *Collection) (updateSch
// TODO: Проверить, что коллекция изменилась
// TODO: Тест на сравнение схем
// Замена возможного алиаса окружения на реального ID окружения перед сравнением
collection.EnvID = exist.EnvID
if !exist.Equal(collection) {
if err = s.content.Collections.Update(ctx, collection); err != nil {
return false, err
......
......@@ -45,7 +45,7 @@ func (cfg *Config) Load(fsys fs.FS) (*Config, error) {
}
if subFS, err := fs.Sub(fsys, "items"); err == nil {
if err = cfg.Items.Load(subFS); err != nil && !errors.Is(err, fs.ErrNotExist) {
if err = cfg.Items.Load(subFS, DecodeItem()); err != nil && !errors.Is(err, fs.ErrNotExist) {
return nil, err
}
}
......
......@@ -90,14 +90,14 @@ func (l *EntityList[C, T]) AddMany(t []T, opt ...EntityOption[C, T]) {
}
// Filter возвращает список сущностей, удовлетворяющих фильтру
func (l *EntityList[C, T]) Filter(filter FilterFunc[T]) []*Entity[C, T] {
var res []*Entity[C, T]
func (l *EntityList[C, T]) Filter(filter FilterFunc[T]) *EntityList[C, T] {
res := make(EntityList[C, T], 0)
for _, e := range *l {
if filter(e.value) {
res = append(res, e)
}
}
return res
return &res
}
// Get возвращает конфигурацию по ID
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment