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) => {
219219 return confirmFlow ?. content
220220 } , [ confirmFlow ] )
221221
222+ // eslint-disable-next-line complexity
222223 const updatePayment = async ( paymentId : string ) : Promise < void > => {
223224 const currentEditState = editStateRef . current
224225 // Send to server only the fields that have changed
@@ -262,12 +263,12 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
262263 const updateMessage = await editPayment ( updates )
263264 toast . success ( updateMessage , { position : toast . POSITION . BOTTOM_RIGHT } )
264265 } catch ( err :any ) {
265- if ( err ?. message ) {
266+ if ( err ?. message ) {
266267 toast . error ( err ?. message , { position : toast . POSITION . BOTTOM_RIGHT } )
267268 } else {
268269 toast . error ( 'Failed to update payment' , { position : toast . POSITION . BOTTOM_RIGHT } )
269270 }
270-
271+
271272 return
272273 }
273274
Original file line number Diff line number Diff line change 1- import { ApiError } from " ./ApiError"
1+ import { ApiError } from ' ./ApiError'
22
33export default interface ApiResponse < T > {
44 status : 'success' | 'error'
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ export async function editPayment(updates: {
8686 if ( response . error && response . error . message ) {
8787 throw new Error ( response . error . message )
8888 }
89+
8990 throw new Error ( 'Error editing payment' )
9091 }
9192
Original file line number Diff line number Diff line change @@ -176,7 +176,8 @@ function interceptError(instance: AxiosInstance): void {
176176 error . message = error ?. response ?. data ?. message
177177 } else if ( error ?. response ?. data ?. error ?. message ) {
178178 error . message = error ?. response ?. data ?. error ?. message
179- }
179+ }
180+
180181 // if there is server errors data, then return it inside `errors` property of error
181182 error . errors = error ?. response ?. data ?. errors
182183 return Promise . reject ( error )
You can’t perform that action at this time.
0 commit comments