mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
fix: accounts types caching.
This commit is contained in:
19
server/src/services/Accounts/AccountsTypesServices.ts
Normal file
19
server/src/services/Accounts/AccountsTypesServices.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Inject, Service } from 'typedi';
|
||||
import TenancyService from 'services/Tenancy/TenancyService';
|
||||
import { IAccountsTypesService, IAccountType } from 'interfaces';
|
||||
|
||||
@Service()
|
||||
export default class AccountsTypesService implements IAccountsTypesService{
|
||||
@Inject()
|
||||
tenancy: TenancyService;
|
||||
|
||||
/**
|
||||
* Retrieve all accounts types.
|
||||
* @param {number} tenantId -
|
||||
* @return {Promise<IAccountType>}
|
||||
*/
|
||||
getAccountsTypes(tenantId: number): Promise<IAccountType> {
|
||||
const { accountTypeRepository } = this.tenancy.repositories(tenantId);
|
||||
return accountTypeRepository.all();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user