Skip to content

Commit

Permalink
We don't know a invited user's email
Browse files Browse the repository at this point in the history
  • Loading branch information
kearfy committed Dec 23, 2023
1 parent a5be3e9 commit f396ffe
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { useSurreal } from '@/lib/Surreal';
import { record } from '@/lib/zod';
import { Link } from '@/locales/navigation';
import { Organisation } from '@/schema/resources/organisation';
import { User, UserAsRelatedUser } from '@/schema/resources/user';
import { User, UserAnonymous } from '@/schema/resources/user';
import { DialogClose } from '@radix-ui/react-dialog';
import { useMutation, useQuery } from '@tanstack/react-query';
import _ from 'lodash';
Expand Down Expand Up @@ -356,7 +356,7 @@ function InvitedManager({
{user.name}{' '}
<Badge className="ml-3">{t('pending-invite')}</Badge>
</TableCell>
<TableCell>{user.email}</TableCell>
<TableCell />
<TableCell>
{!canManage ? (
role
Expand Down Expand Up @@ -513,7 +513,7 @@ const Data = Organisation.extend({
type Data = z.infer<typeof Data>;

const Invited = z.object({
user: UserAsRelatedUser,
user: UserAnonymous,
edge: record('manages'),
role: z.union([
z.literal('owner'),
Expand All @@ -529,6 +529,8 @@ function useData(slug: Organisation['slug']) {
const surreal = useSurreal();
return useQuery({
queryKey: ['organisation', 'members', slug],
retry: false,
throwOnError: true,
queryFn: async () => {
const result = await surreal.query<[null[], Invited[], Data]>(
/* surql */ `
Expand Down

0 comments on commit f396ffe

Please sign in to comment.