fix(Items): Remove bulk actions.

fix(Settings): Parse the fetched settings from the storage.
This commit is contained in:
a.bouhuolia
2021-03-22 11:35:21 +02:00
parent 55771348b5
commit 1f6aca63e2
11 changed files with 265 additions and 289 deletions

View File

@@ -51,13 +51,6 @@ export default class ItemsController extends BaseController {
asyncMiddleware(this.editItem.bind(this)),
this.handlerServiceErrors
);
router.delete(
'/',
[...this.validateBulkSelectSchema],
this.validationResult,
asyncMiddleware(this.bulkDeleteItems.bind(this)),
this.handlerServiceErrors
);
router.delete(
'/:id',
[...this.validateSpecificItemSchema],
@@ -415,28 +408,6 @@ export default class ItemsController extends BaseController {
}
}
/**
* Deletes items in bulk.
* @param {Request} req
* @param {Response} res
* @param {NextFunction} next
*/
async bulkDeleteItems(req: Request, res: Response, next: NextFunction) {
const { tenantId } = req;
const { ids: itemsIds } = req.query;
try {
await this.itemsService.bulkDeleteItems(tenantId, itemsIds);
return res.status(200).send({
ids: itemsIds,
message: 'Items have been deleted successfully.',
});
} catch (error) {
next(error);
}
}
/**
* Handles service errors.
* @param {Error} error