Skip to content
This repository was archived by the owner on Aug 18, 2024. It is now read-only.
This repository was archived by the owner on Aug 18, 2024. It is now read-only.

Getting memberships for a user via jsonapi #730

@ebeyrent

Description

@ebeyrent

Problem/Motivation

As a front-end developer, I want to be able to show a list of all groups a given user has a membership in. With jsonapi, that's fairly trivial:

GET /jsonapi/og_membership/default?filter[uid.id][value]=<uuid>

However, the response gives me the related entity bundle, id, and type of the group associated with the membership. What it's missing is the title of the related group. Because of the field structure here, I can't get all the information I need about the group without making extra requests.

Screen Shot 2021-11-24 at 9 46 33 AM

I see some potential solutions here:

  • Add a new base field for the related group title
  • Add a computed field for the related group title
  • Add a new typed data normalizer to add in the missing group title

Perhaps there are other approaches I haven't considered?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions