diff --git a/apis_ontology/api/serializers.py b/apis_ontology/api/serializers.py index 6ec2ea0..39a1077 100644 --- a/apis_ontology/api/serializers.py +++ b/apis_ontology/api/serializers.py @@ -41,7 +41,7 @@ class Meta: class WorkPreviewSerializer(serializers.ModelSerializer): expression_data = ExpressionDataSerializer(required=False, many=True) - work_type = WorkTypeDataSerializer(required=False, allow_null=True) + work_type = WorkTypeDataSerializer(required=False, allow_empty=True, many=True) class Meta: model = Work diff --git a/apis_ontology/api/views.py b/apis_ontology/api/views.py index 2b9d2c5..81f04ea 100644 --- a/apis_ontology/api/views.py +++ b/apis_ontology/api/views.py @@ -107,7 +107,7 @@ def get_queryset(self): ) ) ), - work_type=Subquery( + work_type=ArraySubquery( work_types.values( json=JSONObject( name="name",