Adds the capability to retrieve a property field by name (#30859)

* Adds the capability to retrieve a property field by name

Allows to retrieve a property field by name and groupID. As the name
is only unique within the context of a group, and we can have multiple
fields with the same name in the store, for this method the groupID is
directly included in the query instead of being an optional field.

* Adds the targetID parameter to correctly filter fields

* Ensure the method only retrieves non-deleted fields

---------

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Miguel de la Cruz
2025-05-13 12:45:35 +02:00
коммит произвёл GitHub
родитель 64ed8f02dc
Коммит 6ab6a008e6
7 изменённых файлов: 244 добавлений и 0 удалений

Просмотреть файл

@@ -1092,6 +1092,7 @@ type PropertyFieldStore interface {
Create(field *model.PropertyField) (*model.PropertyField, error)
Get(groupID, id string) (*model.PropertyField, error)
GetMany(groupID string, ids []string) ([]*model.PropertyField, error)
GetFieldByName(groupID, targetID, name string) (*model.PropertyField, error)
CountForGroup(groupID string, includeDeleted bool) (int64, error)
SearchPropertyFields(opts model.PropertyFieldSearchOpts) ([]*model.PropertyField, error)
Update(groupID string, fields []*model.PropertyField) ([]*model.PropertyField, error)