mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
refactoring: custom views service.
fix: constraints of delete item from storage. fix: constraints of delete item category from storage. fix: localize database seeds files. fix: view meta data in accounts list response.
This commit is contained in:
@@ -27,7 +27,6 @@ export default class HasTenancyService {
|
||||
singletonService(tenantId: number, key: string, callback: Function) {
|
||||
const container = this.tenantContainer(tenantId);
|
||||
const Logger = Container.get('logger');
|
||||
|
||||
const hasServiceInstnace = container.has(key);
|
||||
|
||||
if (!hasServiceInstnace) {
|
||||
@@ -74,12 +73,24 @@ export default class HasTenancyService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets i18n locals function.
|
||||
* @param {number} tenantId
|
||||
* @param locals
|
||||
*/
|
||||
setI18nLocals(tenantId: number, locals: any) {
|
||||
return this.singletonService(tenantId, 'i18n', () => {
|
||||
return locals;
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve i18n locales methods.
|
||||
* @param {number} tenantId - Tenant id.
|
||||
*/
|
||||
i18n(tenantId: number) {
|
||||
return this.singletonService(tenantId, 'i18n', () => {
|
||||
throw new Error('I18n locals is not set yet.');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user