fix
This commit is contained in:
@@ -1701,7 +1701,13 @@ func (p *Pipeline) processOne(ctx context.Context, companyID, jobID uuid.UUID, i
|
||||
// Stick taxonomy unique_id onto mapped_data.category when still empty so the
|
||||
// Products UI (reads mapped) and reprocess keep the AI/vector/mapped pick.
|
||||
if cat := strings.TrimSpace(result.Category); cat != "" {
|
||||
if _, err := tx.Exec(ctx, persistMappedCategorySQL, it.RawID, companyID, cat); err != nil {
|
||||
// Record who chose it: a category this pipeline derived must not read back
|
||||
// as the feed's own on the next run (see MappedCategorySourceKey).
|
||||
catSource, _ := result.FieldSources["category"].(string)
|
||||
if strings.TrimSpace(catSource) == "" {
|
||||
catSource = "pipeline"
|
||||
}
|
||||
if _, err := tx.Exec(ctx, persistMappedCategorySQL, it.RawID, companyID, cat, catSource); err != nil {
|
||||
return false, 0, result, fmt.Errorf("persist mapped category: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user