Fix control object without state

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-02-05 11:07:48 -08:00
parent ace78da341
commit 2723d34592

View File

@@ -54,6 +54,7 @@ func (s Service) CreateControl(
FrameworkID: req.FrameworkID, FrameworkID: req.FrameworkID,
Name: req.Name, Name: req.Name,
Description: req.Description, Description: req.Description,
State: coredata.ControlStateNotStarted,
ContentRef: req.ContentRef, ContentRef: req.ContentRef,
CreatedAt: now, CreatedAt: now,
UpdatedAt: now, UpdatedAt: now,
@@ -63,7 +64,7 @@ func (s Service) CreateControl(
StateTransition: coredata.StateTransition[coredata.ControlState]{ StateTransition: coredata.StateTransition[coredata.ControlState]{
ID: controlStateTransitionID, ID: controlStateTransitionID,
FromState: nil, FromState: nil,
ToState: coredata.ControlStateNotStarted, ToState: control.State,
Reason: ref.Ref("Initial state"), Reason: ref.Ref("Initial state"),
CreatedAt: now, CreatedAt: now,
UpdatedAt: now, UpdatedAt: now,