File tree 1 file changed +10
-2
lines changed
frontend/src/components/job
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
Typography ,
13
13
} from "@mui/material" ;
14
14
import { styled } from "@mui/material/styles" ;
15
+ import { useSnackbar } from "notistack" ;
15
16
import React , { FC , useState } from "react" ;
16
17
import { Link , useNavigate } from "react-router-dom" ;
17
18
@@ -108,6 +109,7 @@ interface Props {
108
109
109
110
export const JobList : FC < Props > = ( { jobs } ) => {
110
111
const navigate = useNavigate ( ) ;
112
+ const { enqueueSnackbar } = useSnackbar ( ) ;
111
113
112
114
const [ encodes , setEncodes ] = useState < {
113
115
[ key : number ] : string ;
@@ -119,8 +121,14 @@ export const JobList: FC<Props> = ({ jobs }) => {
119
121
} ;
120
122
121
123
const handleCancel = async ( jobId : number ) => {
122
- await aironeApiClient . cancelJob ( jobId ) ;
123
- navigate ( 0 ) ;
124
+ await aironeApiClient
125
+ . cancelJob ( jobId )
126
+ . then ( ( ) => {
127
+ navigate ( 0 ) ;
128
+ } )
129
+ . catch ( ( ) => {
130
+ enqueueSnackbar ( "キャンセルに失敗しました。" , { variant : "error" } ) ;
131
+ } ) ;
124
132
} ;
125
133
126
134
return (
You can’t perform that action at this time.
0 commit comments