Produktmanagement hinzugefügt und kleinere Bug behoben
This commit is contained in:
@@ -34,7 +34,7 @@ func (pr *ProductRepository) CreateProduct(product *models.Product) (*models.Pro
|
||||
}
|
||||
|
||||
for _, property := range properties {
|
||||
_, err := pr.valueRepository.createPropertyFromProperty(0, product.ID, property)
|
||||
_, err := pr.valueRepository.createPropertyFromProperty(product.ProductGroupID, product.ID, property)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ func InitHttpServer(config *viper.Viper, dbHandler *sql.DB) HttpServer {
|
||||
router.DELETE("/deleteProduct/:id", productController.DeleteProduct) // delete Product
|
||||
router.GET("/getProduct/:id", productController.GetProduct) // get Product by id
|
||||
router.GET("/getProductsByGroupId/:groupId", productController.GetProductsByGroupId) // get all Products by group ID
|
||||
router.GET("/getPropertiesFromProductId/:productId", productController.GetPropertiesFromProductId) // get Properties from ProductGroup by ID
|
||||
router.POST("/addPropertyToProductId/:productId", productController.AddPropertyToProductId) // add Property to Product by ID
|
||||
router.DELETE("/deletePropertyFromProductId/:productId", productController.DeletePropertyFromProductId) // delete Property from Product by ID
|
||||
|
||||
|
||||
Reference in New Issue
Block a user