diff --git a/lib/api.js b/lib/api.js index 8810fec..a707780 100644 --- a/lib/api.js +++ b/lib/api.js @@ -228,7 +228,14 @@ export function postReviews(collectionId, assetId, reviews) { } export async function getUser() { - cache.user = await apiRequest({endpoint: '/user'}) + const user = await apiRequest({endpoint: '/user'}) + + user.collectionGrants = user.collectionGrants?.map(({ accessLevel, ...grant }) => ({ + ...grant, + roleId: grant.roleId ?? accessLevel + })) || [] + + cache.user = user return cache.user }