feat(API): media field type
This commit is contained in:
1 parent
ad5faf3d19
commit
a2d596f4ca
63 files changed
+2567
-259
No files matched your search
@@ -88,3 +88,13 @@ func UniqueValues(fields []contenttype.Field, data map[string]any) []UniqueValue
|
||||
}
|
||||
return values
|
||||
}
|
||||
|
||||
func MediaIDs(fields []contenttype.Field, data map[string]any) map[string]uint32 {
|
||||
ids := map[string]uint32{}
|
||||
for _, field := range contenttype.MediaFields(fields) {
|
||||
if id, ok := contenttype.MediaID(data[field.Key]); ok {
|
||||
ids[field.Key] = id
|
||||
}
|
||||
}
|
||||
return ids
|
||||
}
|
||||
Reference in new issue
Block a user