0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-31 22:51:25 -05:00

fix(console): should show user initial letter avatar in roles (#4540)

This commit is contained in:
Charles Zhao 2023-09-18 16:06:18 +08:00 committed by GitHub
parent 460784041b
commit ff1da7700f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -101,6 +101,8 @@ describe('role routes', () => {
id: mockUser.id,
avatar: mockUser.avatar,
name: mockUser.name,
username: mockUser.username,
primaryEmail: mockUser.primaryEmail,
},
],
applicationsCount: 0,

View file

@ -99,7 +99,13 @@ export default function roleRoutes<T extends AuthedRouter>(...[router, tenant]:
return {
...role,
usersCount,
featuredUsers: users.map(({ id, avatar, name }) => ({ id, avatar, name })),
featuredUsers: users.map(({ id, avatar, name, username, primaryEmail }) => ({
id,
avatar,
name,
username,
primaryEmail,
})),
applicationsCount,
featuredApplications: applications.map(({ id, name }) => ({ id, name })),
};

View file

@ -2,7 +2,7 @@ import type { Application, Role, User } from '../db-entries/index.js';
export type RoleResponse = Role & {
usersCount: number;
featuredUsers: Array<Pick<User, 'avatar' | 'id' | 'name'>>;
featuredUsers: Array<Pick<User, 'avatar' | 'id' | 'name' | 'username' | 'primaryEmail'>>;
applicationsCount: number;
featuredApplications: Array<Pick<Application, 'id' | 'name'>>;
};