File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed
libs/core/lib/xhr/xhr-functions Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,7 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
219
219
return confirmFlow ?. content
220
220
} , [ confirmFlow ] )
221
221
222
+ // eslint-disable-next-line complexity
222
223
const updatePayment = async ( paymentId : string ) : Promise < void > => {
223
224
const currentEditState = editStateRef . current
224
225
// Send to server only the fields that have changed
@@ -262,12 +263,12 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
262
263
const updateMessage = await editPayment ( updates )
263
264
toast . success ( updateMessage , { position : toast . POSITION . BOTTOM_RIGHT } )
264
265
} catch ( err :any ) {
265
- if ( err ?. message ) {
266
+ if ( err ?. message ) {
266
267
toast . error ( err ?. message , { position : toast . POSITION . BOTTOM_RIGHT } )
267
268
} else {
268
269
toast . error ( 'Failed to update payment' , { position : toast . POSITION . BOTTOM_RIGHT } )
269
270
}
270
-
271
+
271
272
return
272
273
}
273
274
Original file line number Diff line number Diff line change 1
- import { ApiError } from " ./ApiError"
1
+ import { ApiError } from ' ./ApiError'
2
2
3
3
export default interface ApiResponse < T > {
4
4
status : 'success' | 'error'
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ export async function editPayment(updates: {
86
86
if ( response . error && response . error . message ) {
87
87
throw new Error ( response . error . message )
88
88
}
89
+
89
90
throw new Error ( 'Error editing payment' )
90
91
}
91
92
Original file line number Diff line number Diff line change @@ -176,7 +176,8 @@ function interceptError(instance: AxiosInstance): void {
176
176
error . message = error ?. response ?. data ?. message
177
177
} else if ( error ?. response ?. data ?. error ?. message ) {
178
178
error . message = error ?. response ?. data ?. error ?. message
179
- }
179
+ }
180
+
180
181
// if there is server errors data, then return it inside `errors` property of error
181
182
error . errors = error ?. response ?. data ?. errors
182
183
return Promise . reject ( error )
You can’t perform that action at this time.
0 commit comments