mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: reponse readable text and linting some pages.
This commit is contained in:
@@ -130,13 +130,12 @@ export default class CustomersService {
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
public async deleteCustomer(tenantId: number, customerId: number): Promise<void> {
|
||||
const { Contact } = this.tenancy.models(tenantId);
|
||||
this.logger.info('[customer] trying to delete customer.', { tenantId, customerId });
|
||||
|
||||
await this.getCustomerByIdOrThrowError(tenantId, customerId);
|
||||
await this.customerHasNoInvoicesOrThrowError(tenantId, customerId);
|
||||
|
||||
await Contact.query().findById(customerId).delete();
|
||||
await this.contactService.deleteContact(tenantId, customerId, 'customer');
|
||||
|
||||
await this.eventDispatcher.dispatch(events.customers.onDeleted, { tenantId, customerId });
|
||||
this.logger.info('[customer] deleted successfully.', { tenantId, customerId });
|
||||
|
||||
@@ -120,8 +120,6 @@ export default class VendorsService {
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
public async deleteVendor(tenantId: number, vendorId: number) {
|
||||
const { Contact } = this.tenancy.models(tenantId);
|
||||
|
||||
await this.getVendorByIdOrThrowError(tenantId, vendorId);
|
||||
await this.vendorHasNoBillsOrThrowError(tenantId, vendorId);
|
||||
|
||||
@@ -129,7 +127,7 @@ export default class VendorsService {
|
||||
tenantId,
|
||||
vendorId,
|
||||
});
|
||||
await Contact.query().findById(vendorId).delete();
|
||||
await this.contactService.deleteContact(tenantId, vendorId, 'vendor');
|
||||
|
||||
await this.eventDispatcher.dispatch(events.vendors.onDeleted, {
|
||||
tenantId,
|
||||
|
||||
Reference in New Issue
Block a user