import
This commit is contained in:
@@ -143,6 +143,18 @@ func (vr *ValueRepository) GetPropertyType(id int) (*models.PropertyType, error)
|
||||
return &propertyType, nil
|
||||
}
|
||||
|
||||
func (vr *ValueRepository) GetPropertyTypeIDByLabel(label string) (int, error) {
|
||||
// Implement the logic to retrieve the propertyType ID from the database by label
|
||||
query := `SELECT id FROM propertytypes WHERE label=$1`
|
||||
row := vr.db.QueryRow(query, label)
|
||||
var id int
|
||||
err := row.Scan(&id)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return id, nil
|
||||
}
|
||||
|
||||
func (vr *ValueRepository) GetPropertyTypesByGroupId(groupId int) ([]*models.PropertyType, error) {
|
||||
// Implement the logic to retrieve the propertyTypes by groupId from the database
|
||||
query := `SELECT id, label, description, propertytypegroupid FROM propertytypes WHERE propertytypegroupid=$1`
|
||||
|
||||
Reference in New Issue
Block a user