TreeView aufgebaut

This commit is contained in:
2026-10-04 16:41:46 +02:00
parent 7ae541aaa9
commit 5b9c2a4dae
8 changed files with 50 additions and 45 deletions
@@ -39,7 +39,7 @@ func (r *PropertyRepository) GetPropertyByID(id int) (models.Property, error) {
}
var property models.Property
err := r.db.QueryRow("SELECT id, name, description, image_url, parent_property_id, property_type_id, product_groups_id, products_id FROM properties WHERE id = ?", id).Scan(&property.Id, &property.Name, &property.Description, &property.ImageURL, &property.ParentPropertyId, &property.PropertyTypeId, &property.ProductGroupId, &property.ProductId)
err := r.db.QueryRow("SELECT id, name, description, image_url, parent_property_id, property_type_id, product_groups_id, products_id FROM properties.properties WHERE id = $1", id).Scan(&property.Id, &property.Name, &property.Description, &property.ImageURL, &property.ParentPropertyId, &property.PropertyTypeId, &property.ProductGroupId, &property.ProductId)
if err != nil {
return models.Property{}, err
}
@@ -48,7 +48,7 @@ func (r *PropertyRepository) GetPropertyByID(id int) (models.Property, error) {
}
func (r *PropertyRepository) GetPropertiesByProductGroupID(pid int) ([]models.Property, error) {
rows, err := r.db.Query("SELECT id, name, description, image_url, parent_property_id, property_type_id, product_groups_id, products_id FROM properties WHERE product_groups_id = ?", pid)
rows, err := r.db.Query("SELECT id, name, description, image_url, parent_property_id, property_type_id, product_groups_id, products_id FROM properties.properties WHERE product_groups_id = $1", pid)
if err != nil {
return nil, err
}
@@ -75,7 +75,7 @@ func (r *PropertyRepository) GetPropertiesByProductGroupID(pid int) ([]models.Pr
}
func (r *PropertyRepository) GetPropertiesByProductID(pid int) ([]models.Property, error) {
rows, err := r.db.Query("SELECT id, name, description, image_url, parent_property_id, property_type_id, product_groups_id, products_id FROM properties WHERE products_id = ?", pid)
rows, err := r.db.Query("SELECT id, name, description, image_url, parent_property_id, property_type_id, product_groups_id, products_id FROM properties.properties WHERE products_id = $1", pid)
if err != nil {
return nil, err
}
@@ -102,7 +102,7 @@ func (r *PropertyRepository) GetPropertiesByProductID(pid int) ([]models.Propert
}
func (r *PropertyRepository) GetPropertiesByParentPropertyID(pid int) ([]models.Property, error) {
rows, err := r.db.Query("SELECT id, name, description, image_url, parent_property_id, property_type_id, product_groups_id, products_id FROM properties WHERE parent_property_id = ?", pid)
rows, err := r.db.Query("SELECT id, name, description, image_url, parent_property_id, property_type_id, product_groups_id, products_id FROM properties.properties WHERE parent_property_id = $1", pid)
if err != nil {
return nil, err
}
@@ -129,7 +129,7 @@ func (r *PropertyRepository) GetPropertiesByParentPropertyID(pid int) ([]models.
}
func (r *PropertyRepository) GetPropertyByPropertyTypeID(pid int) (models.Property, error) {
rows, err := r.db.Query("SELECT id, name, description, image_url, parent_property_id, property_type_id, product_groups_id, products_id FROM properties WHERE property_type_id = ?", pid)
rows, err := r.db.Query("SELECT id, name, description, image_url, parent_property_id, property_type_id, product_groups_id, products_id FROM properties.properties WHERE property_type_id = $1", pid)
if err != nil {
return models.Property{}, err
}