Added more correct regexp (#76)
This commit is contained in:
@@ -303,7 +303,7 @@ export class ProductAPI extends BaseSQLDataSource {
|
|||||||
|
|
||||||
// Check for unique-path
|
// Check for unique-path
|
||||||
// Get paths from product-products
|
// Get paths from product-products
|
||||||
const basePath = slug(path, { remove: /(\d+)(?!.*\d)/ }); // Remove last number adf-1-asdf-123 = adf-1-asdf-
|
const basePath = slug(path, { remove: /(\d+)(?!.*\d)$/g }); // Remove last number adf-1-asdf-123 = adf-1-asdf-
|
||||||
const pathResponse = await this.knex.raw(
|
const pathResponse = await this.knex.raw(
|
||||||
`SELECT path FROM "product-products" WHERE path LIKE ?`,
|
`SELECT path FROM "product-products" WHERE path LIKE ?`,
|
||||||
[basePath + '%'],
|
[basePath + '%'],
|
||||||
|
|||||||
Reference in New Issue
Block a user