Skip to content
Snippets Groups Projects
Commit f2ccfd45 authored by Semyon Krestyaninov's avatar Semyon Krestyaninov :dog2: Committed by Pavel Antonov
Browse files

Исправлена выгрузка поля `disabled` у `Reference`

parent 58478a6b
No related branches found
No related tags found
No related merge requests found
......@@ -94,8 +94,11 @@ func (t ReferenceType) Encode(_ context.Context, fld *field.Field, v interface{}
ref := map[string]interface{}{
"id": val.ID,
"collection_id": val.CollectionID,
"disabled": val.Disabled,
}
if val.Disabled {
ref["disabled"] = true
}
return ref, nil
}
......
......@@ -117,7 +117,7 @@ func TestReferenceField_Encode(t *testing.T) {
"Correct",
Field(nil),
&Reference{ID: "11111111", CollectionID: "media"},
map[string]interface{}{"collection_id": "media", "id": "11111111", "disabled": false},
map[string]interface{}{"collection_id": "media", "id": "11111111"},
false,
},
{
......@@ -131,7 +131,7 @@ func TestReferenceField_Encode(t *testing.T) {
"Disabled",
Field(nil),
&Reference{ID: "11111111", CollectionID: "media", Disabled: false},
map[string]interface{}{"collection_id": "media", "id": "11111111", "disabled": false},
map[string]interface{}{"collection_id": "media", "id": "11111111"},
false,
},
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment