Skip to content

Commit

Permalink
feat: the first registered user will be the admin
Browse files Browse the repository at this point in the history
  • Loading branch information
boris-w committed Jan 8, 2025
1 parent f620b77 commit 3c790cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/nestjs-backend/src/features/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class UserService {
where: { isSystem: null },
});

const isAdmin = !this.baseConfig.isCloud && userTotalCount === 0;
const isAdmin = userTotalCount === 0;

if (!user?.avatar) {
const avatar = await this.generateDefaultAvatar(user.id!);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ export type ICollaborator = IUserCollaborator | IDepartmentCollaborator;
export const Collaborator = (props: ICollaboratorProps) => {
const { item, className, tips } = props;
return (
<div className={cn('flex flex-1', className)}>
<div
className={cn(
'flex flex-1',
{
'items-center': item.type === PrincipalType.Department,
},
className
)}
>
{item.type === PrincipalType.User && (
<UserAvatar user={{ name: item.name, avatar: item.avatar }} />
)}
Expand Down

0 comments on commit 3c790cc

Please sign in to comment.