Bugfixes
This commit is contained in:
@@ -169,7 +169,7 @@ func (vr *ValueRepository) GetPropertyTypesByGroupId(groupId int) ([]*models.Pro
|
||||
|
||||
func (vr *ValueRepository) CreateValueForPropertyTypeId(propertyTypeId int, value *models.Value) (*models.Value, error) {
|
||||
// Implement the logic to insert the value into the database for the given propertyTypeId
|
||||
query := `INSERT INTO values(propertytypeid, label, description) VALUES($1,$2,$3) RETURNING id`
|
||||
query := `INSERT INTO values(propertyid, label, description) VALUES($1,$2,$3) RETURNING id`
|
||||
err := vr.db.QueryRow(query, propertyTypeId, value.Label, value.Description).Scan(&value.ID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -179,7 +179,7 @@ func (vr *ValueRepository) CreateValueForPropertyTypeId(propertyTypeId int, valu
|
||||
|
||||
func (vr *ValueRepository) DeleteValueFromPropertyTypeId(propertyTypeId int) error {
|
||||
// Implement the logic to delete the value from the database for the given propertyTypeId
|
||||
query := `DELETE FROM values WHERE propertytypeid=$1`
|
||||
query := `DELETE FROM values WHERE propertid=$1`
|
||||
_, err := vr.db.Exec(query, propertyTypeId)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -189,7 +189,7 @@ func (vr *ValueRepository) DeleteValueFromPropertyTypeId(propertyTypeId int) err
|
||||
|
||||
func (vr *ValueRepository) GetValuesFromPropertyTypeId(propertyTypeId int) ([]*models.Value, error) {
|
||||
// Implement the logic to retrieve the values from the database for the given propertyTypeId
|
||||
query := `SELECT id, label, description FROM values WHERE propertytypeid=$1`
|
||||
query := `SELECT id, label, description FROM values WHERE propertyid=$1`
|
||||
rows, err := vr.db.Query(query, propertyTypeId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user