Fix Action logs placeholders for resources
Mainly, It was broken for creation of most resources due to misplace for action-log prop.
This commit is contained in:
@@ -145,7 +145,7 @@ func (svc chart) Create(ctx context.Context, new *types.Chart) (*types.Chart, er
|
||||
var (
|
||||
err error
|
||||
ns *types.Namespace
|
||||
aProps = &chartActionProps{changed: new}
|
||||
aProps = &chartActionProps{chart: new}
|
||||
)
|
||||
|
||||
err = store.Tx(ctx, svc.store, func(ctx context.Context, s store.Storer) (err error) {
|
||||
@@ -175,6 +175,8 @@ func (svc chart) Create(ctx context.Context, new *types.Chart) (*types.Chart, er
|
||||
// generate config element IDs
|
||||
new.Config.GenerateIDs(nextID)
|
||||
|
||||
aProps.setChanged(new)
|
||||
|
||||
if err = store.CreateComposeChart(ctx, s, new); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ func (svc module) procDal(m *types.Module) {
|
||||
func (svc module) Create(ctx context.Context, new *types.Module) (*types.Module, error) {
|
||||
var (
|
||||
ns *types.Namespace
|
||||
aProps = &moduleActionProps{changed: new}
|
||||
aProps = &moduleActionProps{module: new}
|
||||
)
|
||||
|
||||
err := store.Tx(ctx, svc.store, func(ctx context.Context, s store.Storer) (err error) {
|
||||
@@ -382,7 +382,7 @@ func (svc module) Create(ctx context.Context, new *types.Module) (*types.Module,
|
||||
}
|
||||
}
|
||||
|
||||
aProps.setModule(new)
|
||||
aProps.setChanged(new)
|
||||
|
||||
if err = store.CreateComposeModule(ctx, s, new); err != nil {
|
||||
return err
|
||||
|
||||
@@ -218,7 +218,7 @@ func (svc namespace) FindByAny(ctx context.Context, identifier interface{}) (r *
|
||||
// Create adds namespace and presets access rules for role everyone
|
||||
func (svc namespace) Create(ctx context.Context, new *types.Namespace) (*types.Namespace, error) {
|
||||
var (
|
||||
aProps = &namespaceActionProps{changed: new}
|
||||
aProps = &namespaceActionProps{namespace: new}
|
||||
)
|
||||
|
||||
err := store.Tx(ctx, svc.store, func(ctx context.Context, s store.Storer) (err error) {
|
||||
@@ -243,6 +243,8 @@ func (svc namespace) Create(ctx context.Context, new *types.Namespace) (*types.N
|
||||
new.UpdatedAt = nil
|
||||
new.DeletedAt = nil
|
||||
|
||||
aProps.setChanged(new)
|
||||
|
||||
if err = store.CreateComposeNamespace(ctx, svc.store, new); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ func (svc page) Reorder(ctx context.Context, namespaceID, parentID uint64, pageI
|
||||
func (svc page) Create(ctx context.Context, new *types.Page) (*types.Page, error) {
|
||||
var (
|
||||
ns *types.Namespace
|
||||
aProps = &pageActionProps{changed: new}
|
||||
aProps = &pageActionProps{page: new}
|
||||
)
|
||||
|
||||
new.ID = 0
|
||||
@@ -312,6 +312,8 @@ func (svc page) Create(ctx context.Context, new *types.Page) (*types.Page, error
|
||||
new.Blocks[i].BlockID = uint64(i) + 1
|
||||
}
|
||||
|
||||
aProps.setChanged(new)
|
||||
|
||||
if err = store.CreateComposePage(ctx, s, new); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user