mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
WIP: Arabic localization.|
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
import React from 'react';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import { AppToaster } from 'components';
|
||||
import { formatMessage } from 'services/intl';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const transformErrors = (errors) => {
|
||||
if (errors.some((e) => e.type === 'CUSTOMER.HAS.SALES_INVOICES')) {
|
||||
AppToaster.show({
|
||||
message: formatMessage({
|
||||
id: 'customer_has_sales_invoices',
|
||||
}),
|
||||
message: intl.get('customer_has_sales_invoices'),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
@@ -16,18 +14,13 @@ export const transformErrors = (errors) => {
|
||||
errors.find((error) => error.type === 'SOME.CUSTOMERS.HAVE.SALES_INVOICES')
|
||||
) {
|
||||
AppToaster.show({
|
||||
message: formatMessage({
|
||||
id: 'some_customers_have_sales_invoices',
|
||||
}),
|
||||
message: intl.get('some_customers_have_sales_invoices'),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
if (errors.find((error) => error.type === 'CUSTOMER_HAS_TRANSACTIONS')) {
|
||||
AppToaster.show({
|
||||
message: formatMessage({
|
||||
id:
|
||||
'this_customer_cannot_be_deleted_as_it_is_associated_with_transactions',
|
||||
}),
|
||||
message: intl.get('this_customer_cannot_be_deleted_as_it_is_associated_with_transactions'),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user