refactor: add default handler for delete telemetry action
This commit is contained in:
parent
f8f8c14e23
commit
6c84a04fb5
@ -11,7 +11,12 @@ import {
|
|||||||
Typography,
|
Typography,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import React, { useMemo, useState } from 'react';
|
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 { useCurrentWorkspaceId } from '../../store/user';
|
||||||
import { type ColumnsType } from 'antd/es/table/interface';
|
import { type ColumnsType } from 'antd/es/table/interface';
|
||||||
import {
|
import {
|
||||||
@ -209,7 +214,10 @@ const TelemetryListTable: React.FC<{
|
|||||||
workspaceId,
|
workspaceId,
|
||||||
});
|
});
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const deleteMutation = trpc.telemetry.delete.useMutation();
|
const deleteMutation = trpc.telemetry.delete.useMutation({
|
||||||
|
onSuccess: defaultSuccessHandler,
|
||||||
|
onError: defaultErrorHandler,
|
||||||
|
});
|
||||||
|
|
||||||
const columns = useMemo((): ColumnsType<TelemetryInfo> => {
|
const columns = useMemo((): ColumnsType<TelemetryInfo> => {
|
||||||
return [
|
return [
|
||||||
|
Loading…
Reference in New Issue
Block a user