Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEOS-1424: fixes ability to remove a team invite #2682

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import { PlainMessage, Timestamp } from '@bufbuild/protobuf';
import { useMutation, useQuery } from '@connectrpc/connect-query';
import { AccountInvite } from '@neosync/sdk';
import {
deleteAccountApiKey,
getTeamAccountInvites,
removeTeamAccountInvite,
} from '@neosync/sdk/connectquery';
import { TrashIcon } from '@radix-ui/react-icons';
import { toast } from 'sonner';
Expand Down Expand Up @@ -117,7 +117,7 @@ export function InvitesTable(props: Props) {
data={data?.invites || []}
accountId={accountId}
onDeleted={() => refetch()}
onSubmit={() => refetch()}
onInvited={() => refetch()}
/>
);
}
Expand All @@ -126,10 +126,10 @@ interface DataTableProps {
data: AccountInvite[];
accountId: string;
onDeleted(id: string): void;
onSubmit(): void;
onInvited(): void;
}
function DataTable(props: DataTableProps): React.ReactElement {
const { data, accountId, onDeleted, onSubmit } = props;
const { data, accountId, onDeleted, onInvited } = props;
const [sorting, setSorting] = React.useState<SortingState>([]);
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
[]
Expand Down Expand Up @@ -170,7 +170,7 @@ function DataTable(props: DataTableProps): React.ReactElement {
}
className="max-w-sm"
/>
<InviteUserForm accountId={accountId} onInvited={onSubmit} />
<InviteUserForm accountId={accountId} onInvited={onInvited} />
</div>
<div className="rounded-md border">
<Table>
Expand Down Expand Up @@ -232,7 +232,7 @@ interface DeleteInviteButtonProps {
}

function DeleteInviteButton({ inviteId, onDeleted }: DeleteInviteButtonProps) {
const { mutateAsync } = useMutation(deleteAccountApiKey);
const { mutateAsync } = useMutation(removeTeamAccountInvite);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rip


async function onRemove(): Promise<void> {
try {
Expand Down
Loading