mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
fix: record expense, item and item category date session.
fix: delete bulk accounts. fix: activate/inactive bulk accounts.
This commit is contained in:
@@ -23,7 +23,10 @@ export default class AccountsController extends BaseController{
|
||||
const router = Router();
|
||||
|
||||
router.post(
|
||||
'/bulk/:type(activate|inactivate)',
|
||||
'/bulk/:type(activate|inactivate)', [
|
||||
...this.bulkSelectIdsQuerySchema
|
||||
],
|
||||
this.validationResult,
|
||||
asyncMiddleware(this.bulkToggleActivateAccounts.bind(this))
|
||||
);
|
||||
router.post(
|
||||
@@ -74,6 +77,14 @@ export default class AccountsController extends BaseController{
|
||||
this.dynamicListService.handlerErrorsToResponse,
|
||||
this.catchServiceErrors,
|
||||
);
|
||||
router.delete(
|
||||
'/', [
|
||||
...this.bulkSelectIdsQuerySchema,
|
||||
],
|
||||
this.validationResult,
|
||||
asyncMiddleware(this.deleteBulkAccounts.bind(this)),
|
||||
this.catchServiceErrors,
|
||||
);
|
||||
router.delete(
|
||||
'/:id', [
|
||||
...this.accountParamSchema
|
||||
@@ -82,14 +93,6 @@ export default class AccountsController extends BaseController{
|
||||
asyncMiddleware(this.deleteAccount.bind(this)),
|
||||
this.catchServiceErrors,
|
||||
);
|
||||
router.delete(
|
||||
'/', [
|
||||
...this.bulkDeleteSchema,
|
||||
],
|
||||
this.validationResult,
|
||||
asyncMiddleware(this.deleteBulkAccounts.bind(this)),
|
||||
this.catchServiceErrors,
|
||||
);
|
||||
return router;
|
||||
}
|
||||
|
||||
@@ -149,7 +152,7 @@ export default class AccountsController extends BaseController{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
get bulkDeleteSchema() {
|
||||
get bulkSelectIdsQuerySchema() {
|
||||
return [
|
||||
query('ids').isArray({ min: 2 }),
|
||||
query('ids.*').isNumeric().toInt(),
|
||||
|
||||
Reference in New Issue
Block a user