From ff7d82bad63436d60b0084f4446ff8a127da511f Mon Sep 17 00:00:00 2001 From: merdan Date: Wed, 25 Jan 2023 13:57:55 +0500 Subject: [PATCH] LCW IMPORTER GOSHULDY2 --- controllers/ParseController.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/controllers/ParseController.go b/controllers/ParseController.go index 9700d28..87ced9c 100644 --- a/controllers/ParseController.go +++ b/controllers/ParseController.go @@ -43,12 +43,6 @@ func ParseLinkLCW(link string,w http.ResponseWriter) { return } - jsonProduct, err := linkParser.GetProductDetailWithOptions(product.ID, product.ProductGroupID) - - if err != nil { - helper.Error(err) - return - } ///////////////////////////// importRepo, err := repositories.ImporterInstance() @@ -59,14 +53,14 @@ func ParseLinkLCW(link string,w http.ResponseWriter) { //wait until initialization data is loaded to memory importRepo.ImportWGroup.Wait() - if err = importRepo.UpdateOrCreate(jsonProduct).Error; err != nil { + if err = importRepo.UpdateOrCreate(product).Error; err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } w.WriteHeader(http.StatusOK) json.NewEncoder(w).Encode(map[string]string{ "msg": "Link parsed successfully", - "productGroupId": strconv.Itoa(product.ID), + "productGroupId": product.ProductNumber, }) elapsed := time.Since(start)