Skip to content

Commit

Permalink
fix: move to ArraySubquery to allow for > 1 WorkType
Browse files Browse the repository at this point in the history
resolves #121
  • Loading branch information
sennierer authored and koeaw committed May 15, 2024
1 parent 027a02b commit 5e93f3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apis_ontology/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_null=True, many=True)

class Meta:
model = Work
Expand Down
2 changes: 1 addition & 1 deletion apis_ontology/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def get_queryset(self):
)
)
),
work_type=Subquery(
work_type=ArraySubquery(
work_types.values(
json=JSONObject(
name="name",
Expand Down

0 comments on commit 5e93f3c

Please sign in to comment.