mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
fix: transaction locking handling
This commit is contained in:
@@ -69,7 +69,7 @@ function GlobalErrors({
|
||||
if (globalErrors.transactionsLocked) {
|
||||
AppToaster.show({
|
||||
message: intl.get('global_error.transactions_locked', {
|
||||
lockedToDate: globalErrors.transactionsLocked.formatted_locked_to_date,
|
||||
lockedToDate: globalErrors.transactionsLocked.formattedLockedToDate,
|
||||
}),
|
||||
intent: Intent.DANGER,
|
||||
onDismiss: () => {
|
||||
|
||||
@@ -64,12 +64,11 @@ export default function useApiRequest() {
|
||||
setGlobalErrors({ too_many_requests: true });
|
||||
}
|
||||
if (status === 400) {
|
||||
if (
|
||||
data.errors.find(
|
||||
(error) => error.type === 'TRANSACTIONS_DATE_LOCKED',
|
||||
)
|
||||
) {
|
||||
setGlobalErrors({ transactionsLocked: { ...lockedError.data } });
|
||||
const lockedError = data.errors.find(
|
||||
(error) => error.type === 'TRANSACTIONS_DATE_LOCKED',
|
||||
);
|
||||
if (lockedError) {
|
||||
setGlobalErrors({ transactionsLocked: { ...lockedError.payload } });
|
||||
}
|
||||
if (
|
||||
data.errors.find(
|
||||
|
||||
Reference in New Issue
Block a user