feat: reponse readable text and linting some pages.

This commit is contained in:
a.bouhuolia
2021-01-02 10:44:38 +02:00
parent d30e76c5cf
commit b6392e4208
9 changed files with 164 additions and 85 deletions

View File

@@ -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,