In my workshop app, I want users to be able to change their profile picture and personalize their profile. I’m running into an issue because the media visualizer widgets only support object sets that contain a single object.
My idea was to store each user’s profile picture as part of a single object. If I restrict each user’s view so that they can only see their own row in the object set, would that solve the problem? Or would the widget limitation still apply?
If this won’t work, is there a way to fix it, or would I need to build a custom widget specifically for handling profile pictures?
Does your User object type have a Media Reference property that points to the image in the backing Media Set? Or do you have a separate Object Type for uploaded profile pictures/images and a link between them?
If it’s the former, then the logic for the action type that gets triggered when a user uploads a new profile picture should be set to overwrite the previous value which should solve the issue. If it’s the latter, you may want to configure the upload Action Type’s logic to use the most recently uploaded image object linked to that user (which implies that there needs to be a timestamp property for sorting purposes). This is probably something you’ll need a TypeScript function-backed action for so you can define the exact behavior of the data updates