mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 23:00:34 +00:00
fix: add events interfaces of disconnect bank account
This commit is contained in:
@@ -6,7 +6,11 @@ import { PlaidClientWrapper } from '@/lib/Plaid';
|
|||||||
import HasTenancyService from '@/services/Tenancy/TenancyService';
|
import HasTenancyService from '@/services/Tenancy/TenancyService';
|
||||||
import UnitOfWork from '@/services/UnitOfWork';
|
import UnitOfWork from '@/services/UnitOfWork';
|
||||||
import events from '@/subscribers/events';
|
import events from '@/subscribers/events';
|
||||||
import { ERRORS } from './types';
|
import {
|
||||||
|
ERRORS,
|
||||||
|
IBankAccountDisconnectedEventPayload,
|
||||||
|
IBankAccountDisconnectingEventPayload,
|
||||||
|
} from './types';
|
||||||
import { ACCOUNT_TYPE } from '@/data/AccountTypes';
|
import { ACCOUNT_TYPE } from '@/data/AccountTypes';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
@@ -48,7 +52,8 @@ export class DisconnectBankAccount {
|
|||||||
await this.eventPublisher.emitAsync(events.bankAccount.onDisconnecting, {
|
await this.eventPublisher.emitAsync(events.bankAccount.onDisconnecting, {
|
||||||
tenantId,
|
tenantId,
|
||||||
bankAccountId,
|
bankAccountId,
|
||||||
});
|
} as IBankAccountDisconnectingEventPayload);
|
||||||
|
|
||||||
// Remove the Plaid item from the system.
|
// Remove the Plaid item from the system.
|
||||||
await PlaidItem.query(trx).findById(account.plaidItemId).delete();
|
await PlaidItem.query(trx).findById(account.plaidItemId).delete();
|
||||||
|
|
||||||
@@ -66,7 +71,8 @@ export class DisconnectBankAccount {
|
|||||||
await this.eventPublisher.emitAsync(events.bankAccount.onDisconnected, {
|
await this.eventPublisher.emitAsync(events.bankAccount.onDisconnected, {
|
||||||
tenantId,
|
tenantId,
|
||||||
bankAccountId,
|
bankAccountId,
|
||||||
});
|
trx,
|
||||||
|
} as IBankAccountDisconnectedEventPayload);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
import { Position, Toaster, Intent } from '@blueprintjs/core';
|
import { Position, Toaster, Intent } from '@blueprintjs/core';
|
||||||
|
|
||||||
export const AppToaster = Toaster.create({
|
export const AppToaster = Toaster.create({
|
||||||
position: Position.RIGHT_BOTTOM,
|
position: Position.TOP,
|
||||||
intent: Intent.WARNING,
|
intent: Intent.WARNING,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user