From 52d9f792b3fee5acce80f948295b59e3ad2073eb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 29 Jun 2018 14:34:04 +0200 Subject: Client: Add ability to update video channel avatar --- client/src/app/shared/video-channel/video-channel.service.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'client/src/app/shared/video-channel/video-channel.service.ts') diff --git a/client/src/app/shared/video-channel/video-channel.service.ts b/client/src/app/shared/video-channel/video-channel.service.ts index 55e4c2a31..0b9900208 100644 --- a/client/src/app/shared/video-channel/video-channel.service.ts +++ b/client/src/app/shared/video-channel/video-channel.service.ts @@ -9,6 +9,7 @@ import { ResultList } from '../../../../../shared' import { VideoChannel } from './video-channel.model' import { environment } from '../../../environments/environment' import { Account } from '@app/shared/account/account.model' +import { Avatar } from '../../../../../shared/models/avatars/avatar.model' @Injectable() export class VideoChannelService { @@ -54,6 +55,13 @@ export class VideoChannelService { ) } + changeVideoChannelAvatar (videoChannelUUID: string, avatarForm: FormData) { + const url = VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannelUUID + '/avatar/pick' + + return this.authHttp.post<{ avatar: Avatar }>(url, avatarForm) + .pipe(catchError(this.restExtractor.handleError)) + } + removeVideoChannel (videoChannel: VideoChannel) { return this.authHttp.delete(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.uuid) .pipe( -- cgit v1.2.3