Hi I've set my defaultColumns to the following for Media Collection List Page under admin: defaultColumns: ['title', 'customId', 'description', 'fileName'].
However, it doesn't do anything.
Any ideas?
Ty.
You may need to drop the
_preferences
collection in MongoDB. I don't know if there's an easy way to do this, I use Atlas so I just do it from the mongodb website.
If you delete your user and recreate it, preferences will get reset.
but otherwise, dropping that table is the way
got it thank you!
is there anyway to do this without deleting the user and recreating it?
@Alvin Do you mean dropping user preferences?
yes
As like a one time thing? Or in general
Because dropping the _preferences collection will surely do it
Ideally you wouldn't be in this kind of in-between state with preferences
But it can happen with changes to collections, etc
not really a one time. maybe when a user sets its preference on different order
because the problem really for me is when a user logs out and logs back in, the columns are back to its default setup
Hmmm
So not only can you not change the preferences, they don't persist when changed?
yes. is there an config for that or does it save on default?
Hmm
Well there is an API for dealing with user preferences
https://payloadcms.com/docs/admin/preferences#managing-user-preferences
It provides methods like setPreference
After reading through that, will you let me know if you're still stuck?
will do! thank you so much!
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.