Skip to content

Commit

Permalink
refactor: add default handler for delete telemetry action
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Apr 3, 2024
1 parent f8f8c14 commit 6c84a04
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/client/components/telemetry/TelemetryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ import {
Typography,
} from 'antd';
import React, { useMemo, useState } from 'react';
import { AppRouterOutput, trpc } from '../../api/trpc';
import {
AppRouterOutput,
defaultErrorHandler,
defaultSuccessHandler,
trpc,
} from '../../api/trpc';
import { useCurrentWorkspaceId } from '../../store/user';
import { type ColumnsType } from 'antd/es/table/interface';
import {
Expand Down Expand Up @@ -209,7 +214,10 @@ const TelemetryListTable: React.FC<{
workspaceId,
});
const navigate = useNavigate();
const deleteMutation = trpc.telemetry.delete.useMutation();
const deleteMutation = trpc.telemetry.delete.useMutation({
onSuccess: defaultSuccessHandler,
onError: defaultErrorHandler,
});

const columns = useMemo((): ColumnsType<TelemetryInfo> => {
return [
Expand Down

0 comments on commit 6c84a04

Please sign in to comment.