mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
add error message
This commit is contained in:
@ -89,7 +89,7 @@ class PaymentMethodsController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($paymentMethod->expenses()->exists()) {
|
if ($paymentMethod->expenses()->exists()) {
|
||||||
return respondJson('payments_attached', 'Expenses Attached.');
|
return respondJson('expenses_attached', 'Expenses Attached.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$paymentMethod->delete();
|
$paymentMethod->delete();
|
||||||
|
|||||||
@ -861,9 +861,21 @@ async function installModule() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!requestResponse.data.success) {
|
if (!requestResponse.data.success) {
|
||||||
|
let displayMsg = ref('')
|
||||||
|
|
||||||
|
if (
|
||||||
|
requestResponse.data.message === 'crater_version_is_not_supported'
|
||||||
|
) {
|
||||||
|
displayMsg.value = t('modules.version_not_supported', {
|
||||||
|
version: requestResponse.data.min_crater_version,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
displayMsg.value = getErrorMessage(requestResponse.data.message)
|
||||||
|
}
|
||||||
|
|
||||||
notificationStore.showNotification({
|
notificationStore.showNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: getErrorMessage(requestResponse.data.message),
|
message: displayMsg.value,
|
||||||
})
|
})
|
||||||
|
|
||||||
isInstalling.value = false
|
isInstalling.value = false
|
||||||
|
|||||||
@ -62,7 +62,11 @@ export const showError = (error) => {
|
|||||||
break
|
break
|
||||||
|
|
||||||
case 'payments_attached':
|
case 'payments_attached':
|
||||||
showToaster('settings.payment_modes.already_in_use')
|
showToaster('settings.payment_modes.payments_attached')
|
||||||
|
break
|
||||||
|
|
||||||
|
case 'expenses_attached':
|
||||||
|
showToaster('settings.payment_modes.expenses_attached')
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'role_attached_to_users':
|
case 'role_attached_to_users':
|
||||||
|
|||||||
@ -686,7 +686,7 @@
|
|||||||
"no_reviews_found": "There are no reviews for this module yet!",
|
"no_reviews_found": "There are no reviews for this module yet!",
|
||||||
"module_not_purchased": "Module Not Purchased",
|
"module_not_purchased": "Module Not Purchased",
|
||||||
"module_not_found": "Module Not Found",
|
"module_not_found": "Module Not Found",
|
||||||
"version_not_supported": "This module version doesn't support the current version of Crater",
|
"version_not_supported": "The minimum required version for this module does not match. Please upgrade your crater app to version: {version} to proceed.",
|
||||||
"last_updated": "Last Updated On",
|
"last_updated": "Last Updated On",
|
||||||
"connect_installation": "Connect your installation",
|
"connect_installation": "Connect your installation",
|
||||||
"api_token_description": "Login to {url} and connect this installation by entering the API Token. Your purchased modules will show up here after the connection is established.",
|
"api_token_description": "Login to {url} and connect this installation by entering the API Token. Your purchased modules will show up here after the connection is established.",
|
||||||
@ -1146,7 +1146,8 @@
|
|||||||
"payment_mode_added": "Payment Mode Added",
|
"payment_mode_added": "Payment Mode Added",
|
||||||
"payment_mode_updated": "Payment Mode Updated",
|
"payment_mode_updated": "Payment Mode Updated",
|
||||||
"payment_mode_confirm_delete": "You will not be able to recover this Payment Mode",
|
"payment_mode_confirm_delete": "You will not be able to recover this Payment Mode",
|
||||||
"already_in_use": "Payment Mode is already in use",
|
"payments_attached": "This payment method is already attached to payments. Please delete the attached payments to proceed with deletion.",
|
||||||
|
"expenses_attached": "This payment method is already attached to expenses. Please delete the attached expenses to proceed with deletion.",
|
||||||
"deleted_message": "Payment Mode deleted successfully"
|
"deleted_message": "Payment Mode deleted successfully"
|
||||||
},
|
},
|
||||||
"expense_category": {
|
"expense_category": {
|
||||||
|
|||||||
Reference in New Issue
Block a user