mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
refactor: branches and warehouses to nestjs
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { Branch } from '../models/Branch.model';
|
||||
|
||||
@Injectable()
|
||||
export class GetBranchesService {
|
||||
constructor(
|
||||
@Inject(Branch.name)
|
||||
private readonly branch: typeof Branch,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Retrieves branches list.
|
||||
* @returns
|
||||
*/
|
||||
public getBranches = async () => {
|
||||
const branches = await this.branch.query().orderBy('name', 'DESC');
|
||||
|
||||
return branches;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user