mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
22 lines
500 B
TypeScript
22 lines
500 B
TypeScript
import { Inject, Service } from 'typedi';
|
|
import HasTenancyService from '@/services/Tenancy/TenancyService';
|
|
|
|
@Service()
|
|
export class GetWarehouses {
|
|
@Inject()
|
|
tenancy: HasTenancyService;
|
|
|
|
/**
|
|
* Retrieves warehouses list.
|
|
* @param {number} tenantId
|
|
* @returns
|
|
*/
|
|
public getWarehouses = async (tenantId: number) => {
|
|
const { Warehouse } = this.tenancy.models(tenantId);
|
|
|
|
const warehouses = await Warehouse.query().orderBy('name', 'DESC');
|
|
|
|
return warehouses;
|
|
};
|
|
}
|