diff --git a/Common/Server/API/BaseAPI.ts b/Common/Server/API/BaseAPI.ts index 4b692469cf..e9e508270f 100644 --- a/Common/Server/API/BaseAPI.ts +++ b/Common/Server/API/BaseAPI.ts @@ -131,6 +131,31 @@ export default class BaseAPI< }, ); + router.post( + `${new this.entityType().getCrudApiPath()?.toString()}/:id/update-item`, + UserMiddleware.getUserMiddleware, + async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => { + try { + await this.updateItem(req, res); + } catch (err) { + next(err); + } + }, + ); + + + router.get( + `${new this.entityType().getCrudApiPath()?.toString()}/:id/update-item`, + UserMiddleware.getUserMiddleware, + async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => { + try { + await this.updateItem(req, res); + } catch (err) { + next(err); + } + }, + ); + // Delete router.delete( `${new this.entityType().getCrudApiPath()?.toString()}/:id`, @@ -144,6 +169,30 @@ export default class BaseAPI< }, ); + router.post( + `${new this.entityType().getCrudApiPath()?.toString()}/:id/delete-item`, + UserMiddleware.getUserMiddleware, + async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => { + try { + await this.deleteItem(req, res); + } catch (err) { + next(err); + } + }, + ); + + router.get( + `${new this.entityType().getCrudApiPath()?.toString()}/:id/delete-item`, + UserMiddleware.getUserMiddleware, + async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => { + try { + await this.deleteItem(req, res); + } catch (err) { + next(err); + } + }, + ); + this.router = router; this.service = service; } diff --git a/Common/Server/Services/WorkspaceNotificationRuleService.ts b/Common/Server/Services/WorkspaceNotificationRuleService.ts index cb0170fc08..d9587166a9 100644 --- a/Common/Server/Services/WorkspaceNotificationRuleService.ts +++ b/Common/Server/Services/WorkspaceNotificationRuleService.ts @@ -249,7 +249,7 @@ export class Service extends DatabaseService { const monitorLabels: Array