mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
fix: save payee contact to expense transaction.
This commit is contained in:
@@ -31,13 +31,17 @@ export default class ContactsService {
|
||||
* @param {TContactService} contactService
|
||||
* @return {Promise<IContact>}
|
||||
*/
|
||||
public async getContactByIdOrThrowError(tenantId: number, contactId: number, contactService: TContactService) {
|
||||
public async getContactByIdOrThrowError(
|
||||
tenantId: number,
|
||||
contactId: number,
|
||||
contactService?: TContactService
|
||||
) {
|
||||
const { contactRepository } = this.tenancy.repositories(tenantId);
|
||||
|
||||
this.logger.info('[contact] trying to validate contact existance.', { tenantId, contactId });
|
||||
const contact = await contactRepository.findOne({
|
||||
id: contactId,
|
||||
contactService: contactService,
|
||||
...(contactService) && ({ contactService }),
|
||||
});
|
||||
|
||||
if (!contact) {
|
||||
|
||||
Reference in New Issue
Block a user