fix
This commit is contained in:
@@ -358,6 +358,15 @@ func cloneCompanyCatalog(ctx context.Context, pool *pgxpool.Pool, src, dest uuid
|
||||
}
|
||||
add("raw_products", ct.RowsAffected())
|
||||
|
||||
var mappedWithCat int64
|
||||
if err := tx.QueryRow(ctx, `
|
||||
SELECT COUNT(*) FROM raw_products
|
||||
WHERE company_id = $1
|
||||
AND COALESCE(NULLIF(trim(mapped_data->>'category'), ''), '') <> ''`, dest).Scan(&mappedWithCat); err != nil {
|
||||
return nil, fmt.Errorf("count mapped categories: %w", err)
|
||||
}
|
||||
add("mapped_with_category", mappedWithCat)
|
||||
|
||||
ct, err = tx.Exec(ctx, `
|
||||
INSERT INTO processed_products (
|
||||
id, company_id, user_id, product_id, name, category, description, processed_description,
|
||||
|
||||
Reference in New Issue
Block a user