mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-14 11:50:31 +00:00
18 lines
453 B
JavaScript
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,
|
|
});
|
|
}
|
|
};
|