mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
fix: system repositories.
This commit is contained in:
@@ -4,19 +4,18 @@ import { Expense } from 'models';
|
||||
|
||||
export default class ExpenseRepository extends TenantRepository {
|
||||
/**
|
||||
* Constructor method.
|
||||
* Gets the repository's model.
|
||||
*/
|
||||
constructor(knex, cache) {
|
||||
super(knex, cache);
|
||||
this.model = Expense;
|
||||
get model() {
|
||||
return Expense.bindKnex(this.knex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish the given expense.
|
||||
* @param {number} expenseId
|
||||
*/
|
||||
async publish(expenseId: number): Promise<void> {
|
||||
super.update({
|
||||
publish(expenseId: number): Promise<void> {
|
||||
return super.update({
|
||||
id: expenseId,
|
||||
publishedAt: moment().toMySqlDateTime(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user