Instead of exposing Role.content_type, create a new serializer field

called `object_type`, which is constructed based on manipulating the
string value of ActivityStream.object_relationship_type.  Since that
field does have the full class name, this manipulation should match
the manipulation that is done to construct the values of object1 and
object2 when ActivityStream is created.
This commit is contained in:
Jeff Bradberry
2019-05-10 17:31:33 -04:00
parent 250484339b
commit d6e89092d3
2 changed files with 20 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ export default function BuildDescription(BuildAnchor, $log, i18n) {
// if object1 winds up being the role's resource, we need to swap the objects
// in order to make the sentence make sense.
if (activity.summary_fields.role[0].content_type === object1) {
if (activity.object_type === object1) {
object1 = activity.object2;
object2 = activity.object1;
}