removing batch info from the url (#116)

* removing batch info from the url

* small CR changes

Co-authored-by: Sreeraj Rajendran Nair <sreeraj.rajendran@photowall.com>
This commit is contained in:
Sreeraj Rajendran Nair
2022-09-07 11:06:07 +02:00
committed by GitHub
co-authored by Sreeraj Rajendran Nair
parent eeb69fe5f0
commit b2fa2f7d8a
+2 -3
View File
@@ -393,7 +393,7 @@ export class ProductAPI extends BaseSQLDataSource {
/**
* @function addProduct
* @description Adds a new product to system, will use batchname and name to
* @description Adds a new product to system, will use name to
* set a unique path, artNo is the productId with e infront.
*/
async addProduct(
@@ -402,8 +402,7 @@ export class ProductAPI extends BaseSQLDataSource {
designerId: number,
): Promise<number> {
const fixedBatch = !!batch ? batch : '';
const path = batch ? fixedBatch + ' ' + name : name;
const productPath = slug(path);
const productPath = slug(name);
const safePath = await this.getUniqueProductPath(productPath, null);
const idres = await this.knex