Files
bigcapital/src/containers/Dialogs/BadDebtDialog/utils.js
2021-11-01 20:24:01 +02:00

18 lines
453 B
JavaScript

import React from 'react';
import { Intent } from '@blueprintjs/core';
import { AppToaster } from 'components';
/**
* Transformes the response errors types.
*/
export const transformErrors = (errors, { setErrors }) => {
if (errors.some(({ type }) => type === 'SALE_INVOICE_ALREADY_WRITTEN_OFF')) {
AppToaster.show({
message: 'SALE_INVOICE_ALREADY_WRITTEN_OFF',
// message: intl.get(''),
intent: Intent.DANGER,
});
}
};