Skip to content

Commit

Permalink
responseにexceptionIdが含まれるかどうかで処理を分岐するよう修正
Browse files Browse the repository at this point in the history
  • Loading branch information
rnakagawa16 committed Dec 23, 2024
1 parent 6efb080 commit 612c71a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const update = async (catalogItemId: number, newQuantity: number) => {
error,
() => {},
(httpError: HttpError) => {
if (!httpError.response) {
if (!httpError.response?.exceptionId) {
showToast(t('failedToChangeQuantities'));
} else {
const message = errorMessageFormat(
Expand Down Expand Up @@ -77,7 +77,7 @@ const remove = async (catalogItemId: number) => {
error,
() => {},
(httpError: HttpError) => {
if (!httpError.response) {
if (!httpError.response?.exceptionId) {
showToast(t('failedToDeleteItems'));
} else {
const message = errorMessageFormat(
Expand Down Expand Up @@ -111,7 +111,7 @@ onMounted(async () => {
error,
() => {},
(httpError: HttpError) => {
if (!httpError.response) {
if (!httpError.response?.exceptionId) {
showToast(t('failedToGetCarts'));
} else {
const message = errorMessageFormat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const addBasket = async (catalogItemId: number) => {
error,
() => {},
(httpError: HttpError) => {
if (!httpError.response) {
if (!httpError.response?.exceptionId) {
showToast(t('failedToAddItemToCarts'));
} else {
const message = errorMessageFormat(
Expand Down Expand Up @@ -78,7 +78,7 @@ onMounted(async () => {
error,
() => {},
(httpError: HttpError) => {
if (!httpError.response) {
if (!httpError.response?.exceptionId) {
showToast(t('failedToGetItems'));
} else {
const message = errorMessageFormat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const checkout = async () => {
router.push({ name: 'error' });
},
(httpError: HttpError) => {
if (!httpError.response) {
if (!httpError.response?.exceptionId) {
showToast(t('failedToOrderItems'));
} else {
const message = errorMessageFormat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ onMounted(async () => {
router.push('/');
},
(httpError: HttpError) => {
if (!httpError.response) {
if (!httpError.response?.exceptionId) {
showToast(t('failedToOrderInformation'));
} else {
const message = errorMessageFormat(
Expand Down

0 comments on commit 612c71a

Please sign in to comment.