fix: More instances of wrong avatar URL fixed (#10519)
* Fix user.avatar * Fix avtars in admin users listing * Handle unpublished org
This commit is contained in:
1 parent
5491821baf
commit
bf45dcf139
5 files changed
+27
-15
No files matched your search
@@ -104,7 +104,9 @@ export async function getUserFromSession(ctx: TRPCContextInner, session: Maybe<S
|
||||
const orgMetadata = teamMetadataSchema.parse(user.organization?.metadata || {});
|
||||
const rawAvatar = user.avatar;
|
||||
// This helps to prevent reaching the 4MB payload limit by avoiding base64 and instead passing the avatar url
|
||||
user.avatar = rawAvatar ? `${WEBAPP_URL}/${user.username}/avatar.png` : defaultAvatarSrc({ email });
|
||||
user.avatar = rawAvatar
|
||||
? `${WEBAPP_URL}/${user.username}/avatar.png?orgId=${user.organizationId}`
|
||||
: defaultAvatarSrc({ email });
|
||||
const locale = user?.locale || ctx.locale;
|
||||
|
||||
const isOrgAdmin = !!user.organization?.members.length;
|
||||
|
||||
@@ -49,6 +49,7 @@ export const listPaginatedHandler = async ({ ctx, input }: GetOptions) => {
|
||||
name: true,
|
||||
timeZone: true,
|
||||
role: true,
|
||||
organizationId: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user