mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: apply new cards design system.
feat: empty status datatables. fix: edit account.
This commit is contained in:
@@ -198,7 +198,11 @@ export default class AccountsController extends BaseController{
|
||||
|
||||
try {
|
||||
const account = await this.accountsService.editAccount(tenantId, accountId, accountDTO);
|
||||
return res.status(200).send({ id: account.id });
|
||||
|
||||
return res.status(200).send({
|
||||
id: account.id,
|
||||
message: 'The account has been edited successfully',
|
||||
});
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
|
||||
@@ -107,10 +107,12 @@ export default class AccountRepository extends TenantRepository {
|
||||
* @param {IAccount} account
|
||||
* @return {void}
|
||||
*/
|
||||
async edit(accountId: number, account: IAccount): Promise<void> {
|
||||
async edit(accountId: number, accountInput: IAccount): Promise<void> {
|
||||
const { Account } = this.models;
|
||||
await Account.query().findById(accountId).patch({ ...account });
|
||||
const account = await Account.query().patchAndFetchById(accountId, { ...accountInput });
|
||||
this.flushCache();
|
||||
|
||||
return account;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -203,6 +203,8 @@ export default class AccountsService {
|
||||
* @param {IAccountDTO} accountDTO
|
||||
*/
|
||||
public async editAccount(tenantId: number, accountId: number, accountDTO: IAccountDTO) {
|
||||
this.logger.info('[account] trying to edit account.', { tenantId, accountId });
|
||||
|
||||
const { accountRepository } = this.tenancy.repositories(tenantId);
|
||||
const oldAccount = await this.getAccountOrThrowError(tenantId, accountId);
|
||||
|
||||
|
||||
@@ -407,6 +407,7 @@ export default class ManualJournalsService implements IManualJournalsService {
|
||||
this.logger.info('[manual_journals] trying to get manual journals list.', { tenantId, filter });
|
||||
const { results, pagination } = await ManualJournal.query().onBuild((builder) => {
|
||||
dynamicList.buildQuery()(builder);
|
||||
builder.withGraphFetched('entries.account');
|
||||
}).pagination(filter.page - 1, filter.pageSize);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user