Validate product and collection handles to be URL safe (#7310)

* fix: allow URL safe characters for product handle

Fixes: CORE-2072
This commit is contained in:
Harminder Virk
2024-05-15 17:50:26 +02:00
committed by GitHub
parent 7c4f4d7388
commit 17486cda99
8 changed files with 146 additions and 10 deletions
@@ -17,9 +17,9 @@ import {
createPsqlIndexStatementHelper,
DALUtils,
generateEntityId,
kebabCase,
ProductUtils,
Searchable,
toHandle,
} from "@medusajs/utils"
import ProductCategory from "./product-category"
import ProductCollection from "./product-collection"
@@ -216,7 +216,7 @@ class Product {
this.collection_id ??= this.collection?.id ?? null
if (!this.handle && this.title) {
this.handle = kebabCase(this.title)
this.handle = toHandle(this.title)
}
}
}