fixed panic on expanding existing byt non-relation type field

This commit is contained in:
Gani Georgiev
2022-07-30 07:58:42 +03:00
parent 9e3b230c8e
commit bb527be493
2 changed files with 18 additions and 5 deletions

View File

@@ -63,7 +63,7 @@ func TestExpandRecords(t *testing.T) {
0,
2,
},
// invalid missing first level expand
// missing relation field
{
[]string{"b8ba58f9-e2d7-42a0-b0e7-a11efd98236b", "df55c8ff-45ef-4c82-8aed-6e2183fe1125"},
[]string{"invalid"},
@@ -73,7 +73,17 @@ func TestExpandRecords(t *testing.T) {
0,
1,
},
// invalid missing second level expand
// existing, but non-relation type field
{
[]string{"b8ba58f9-e2d7-42a0-b0e7-a11efd98236b", "df55c8ff-45ef-4c82-8aed-6e2183fe1125"},
[]string{"title"},
func(c *models.Collection, ids []string) ([]*models.Record, error) {
return app.Dao().FindRecordsByIds(c, ids, nil)
},
0,
1,
},
// invalid/missing second level expand
{
[]string{"b8ba58f9-e2d7-42a0-b0e7-a11efd98236b", "df55c8ff-45ef-4c82-8aed-6e2183fe1125"},
[]string{"manyrels.invalid"},