fix
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/descrybe/descrybe-v2/apps/api/internal/company"
|
||||
@@ -167,6 +168,13 @@ func (s *Service) CreateCategory(ctx context.Context, companyID uuid.UUID, name,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// New categories start with the platform-default formula so enhance produces
|
||||
// formula-shaped copy instead of generic paragraphs. Non-fatal: a category
|
||||
// without a stored formula still falls back to the default at enhance time.
|
||||
if err := ApplyDefaultCategoryFormulas(ctx, s.Pool, companyID,
|
||||
DefaultFormulaTarget{ID: id, UniqueID: uniqueID, Name: name}); err != nil {
|
||||
log.Printf("catalog: default formulas company=%s category=%s err=%v", companyID, id, err)
|
||||
}
|
||||
return s.GetCategory(ctx, companyID, id)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user