Skip to content

Commit

Permalink
Correct error message when placing an order fails (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
indykoning authored Oct 17, 2024
1 parent 8e23295 commit eaefe1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion resources/js/components/Checkout/Checkout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import InteractWithUser from './../User/mixins/InteractWithUser'
import { useEventListener, useLocalStorage } from '@vueuse/core'
import useMask from '../../stores/useMask'
import { cart, hasOnlyVirtualItems, virtualItems, linkUserToCart } from '../../stores/useCart'
import { FetchError } from '../../fetch'
export default {
mixins: [InteractWithUser],
Expand Down Expand Up @@ -242,7 +243,10 @@ export default {
return true
} catch (error) {
Notify(error.response.data.message, 'error', error.response.data?.parameters)
if (FetchError.prototype.isPrototypeOf(error)) {
const response = await error.response.json()
Notify(response?.message, 'error', response?.parameters)
}
return false
}
},
Expand Down

0 comments on commit eaefe1f

Please sign in to comment.