From 1ebddadd0704812a4600c39cabe2268321e88331 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 22 Jun 2020 13:00:39 +0200 Subject: predefined report reasons & improved reporter UI (#2842) - added `startAt` and `endAt` optional timestamps to help pin down reported sections of a video - added predefined report reasons - added video player with report modal --- client/src/app/shared/video-abuse/video-abuse.service.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'client/src/app/shared/video-abuse/video-abuse.service.ts') diff --git a/client/src/app/shared/video-abuse/video-abuse.service.ts b/client/src/app/shared/video-abuse/video-abuse.service.ts index 700a30239..43f4674b1 100644 --- a/client/src/app/shared/video-abuse/video-abuse.service.ts +++ b/client/src/app/shared/video-abuse/video-abuse.service.ts @@ -3,9 +3,10 @@ import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' import { SortMeta } from 'primeng/api' import { Observable } from 'rxjs' -import { ResultList, VideoAbuse, VideoAbuseUpdate, VideoAbuseState } from '../../../../../shared' +import { ResultList, VideoAbuse, VideoAbuseCreate, VideoAbuseState, VideoAbuseUpdate } from '../../../../../shared' import { environment } from '../../../environments/environment' import { RestExtractor, RestPagination, RestService } from '../rest' +import { omit } from 'lodash-es' @Injectable() export class VideoAbuseService { @@ -51,7 +52,8 @@ export class VideoAbuseService { } }, searchReporter: { prefix: 'reporter:' }, - searchReportee: { prefix: 'reportee:' } + searchReportee: { prefix: 'reportee:' }, + predefinedReason: { prefix: 'tag:' } }) params = this.restService.addObjectParams(params, filters) @@ -63,9 +65,10 @@ export class VideoAbuseService { ) } - reportVideo (id: number, reason: string) { - const url = VideoAbuseService.BASE_VIDEO_ABUSE_URL + id + '/abuse' - const body = { reason } + reportVideo (parameters: { id: number } & VideoAbuseCreate) { + const url = VideoAbuseService.BASE_VIDEO_ABUSE_URL + parameters.id + '/abuse' + + const body = omit(parameters, [ 'id' ]) return this.authHttp.post(url, body) .pipe( -- cgit v1.2.3