Skip to content

The Open Source DocuSign Alternative.

fix: quick tweaks

Lucas Smith4c8a62a8ab41
diff --git a/apps/web/src/app/(dashboard)/admin/users/[id]/page.tsx b/apps/web/src/app/(dashboard)/admin/users/[id]/page.tsx
index e1535c16e..790177c8a 100644
--- a/apps/web/src/app/(dashboard)/admin/users/[id]/page.tsx
+++ b/apps/web/src/app/(dashboard)/admin/users/[id]/page.tsx
@@ -25,7 +25,7 @@ export default function UserPage({ params }: { params: { id: number } }) {
const { toast } = useToast();
const router = useRouter();
- const result = trpc.profile.getUser.useQuery(
+ const { data: user } = trpc.profile.getUser.useQuery(
{
id: Number(params.id),
},
@@ -34,8 +34,6 @@ export default function UserPage({ params }: { params: { id: number } }) {
},
);
- const user = result.data;
-
const roles = user?.roles ?? [];
const { mutateAsync: updateUserMutation } = trpc.admin.updateUser.useMutation();
diff --git a/apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx b/apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx
index b6b475ea2..1840f5a44 100644
--- a/apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx
+++ b/apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx
@@ -95,19 +95,7 @@ export const UsersDataTable = ({ users, totalPages, perPage, page }: UsersDataTa
{
header: 'Roles',
accessorKey: 'roles',
- cell: ({ row }) => {
- return (
- <>
- {row.original.roles.map((role: string, i: number) => {
- return (
- <span key={i}>
- {role} {}
- </span>
- );
- })}
- </>
- );
- },
+ cell: ({ row }) => row.original.roles.join(', '),
},
{
header: 'Subscription',
@@ -134,18 +122,16 @@ export const UsersDataTable = ({ users, totalPages, perPage, page }: UsersDataTa
},
},
{
- header: 'Edit',
+ header: '',
accessorKey: 'edit',
cell: ({ row }) => {
return (
- <div>
- <Button className="w-24" asChild>
- <Link href={`/admin/users/${row.original.id}`}>
- <Edit className="-ml-1 mr-2 h-4 w-4" />
- Edit
- </Link>
- </Button>
- </div>
+ <Button className="w-24" asChild>
+ <Link href={`/admin/users/${row.original.id}`}>
+ <Edit className="-ml-1 mr-2 h-4 w-4" />
+ Edit
+ </Link>
+ </Button>
);
},
},