From 758abde4101d82ecf52aa84e8cd78d333cee3b3d Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Fri, 18 Jan 2019 18:49:40 +0100 Subject: [PATCH] simplify followRecommendation for motionBlock --- .../motion-block-detail.component.ts | 9 +------- .../motion-block-repository.service.ts | 23 +++++++++++++++---- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.ts b/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.ts index 39bd9f0a9..faef863e4 100644 --- a/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.ts +++ b/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.ts @@ -8,7 +8,6 @@ import { TranslateService } from '@ngx-translate/core'; import { ListViewBaseComponent } from 'app/site/base/list-view-base'; import { MotionBlockRepositoryService } from '../../services/motion-block-repository.service'; -import { MotionRepositoryService } from '../../services/motion-repository.service'; import { MotionBlock } from 'app/shared/models/motions/motion-block'; import { ViewMotionBlock } from '../../models/view-motion-block'; import { ViewMotion } from '../../models/view-motion'; @@ -53,7 +52,6 @@ export class MotionBlockDetailComponent extends ListViewBaseComponent block.title === title); } + + /** + * Signals the acceptance of the current recommendation of this motionBlock + * + * @param motionBlock + */ + public async followRecommendation(motionBlock: ViewMotionBlock): Promise { + const restPath = `/rest/motions/motion-block/${motionBlock.id}/follow_recommendations/`; + await this.httpService.post(restPath); + } }