diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-29 14:34:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-29 14:34:04 +0200 |
commit | 52d9f792b3fee5acce80f948295b59e3ad2073eb (patch) | |
tree | 661f577e9c7196d199b4b49e475ecd2d88e6d7b7 /client/src/app/shared/video-channel | |
parent | 4bbfc6c606c8d3794bae25c64c516120af41f4eb (diff) | |
download | PeerTube-52d9f792b3fee5acce80f948295b59e3ad2073eb.tar.gz PeerTube-52d9f792b3fee5acce80f948295b59e3ad2073eb.tar.zst PeerTube-52d9f792b3fee5acce80f948295b59e3ad2073eb.zip |
Client: Add ability to update video channel avatar
Diffstat (limited to 'client/src/app/shared/video-channel')
-rw-r--r-- | client/src/app/shared/video-channel/video-channel.service.ts | 8 |
1 files changed, 8 insertions, 0 deletions
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' | |||
9 | import { VideoChannel } from './video-channel.model' | 9 | import { VideoChannel } from './video-channel.model' |
10 | import { environment } from '../../../environments/environment' | 10 | import { environment } from '../../../environments/environment' |
11 | import { Account } from '@app/shared/account/account.model' | 11 | import { Account } from '@app/shared/account/account.model' |
12 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' | ||
12 | 13 | ||
13 | @Injectable() | 14 | @Injectable() |
14 | export class VideoChannelService { | 15 | export class VideoChannelService { |
@@ -54,6 +55,13 @@ export class VideoChannelService { | |||
54 | ) | 55 | ) |
55 | } | 56 | } |
56 | 57 | ||
58 | changeVideoChannelAvatar (videoChannelUUID: string, avatarForm: FormData) { | ||
59 | const url = VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannelUUID + '/avatar/pick' | ||
60 | |||
61 | return this.authHttp.post<{ avatar: Avatar }>(url, avatarForm) | ||
62 | .pipe(catchError(this.restExtractor.handleError)) | ||
63 | } | ||
64 | |||
57 | removeVideoChannel (videoChannel: VideoChannel) { | 65 | removeVideoChannel (videoChannel: VideoChannel) { |
58 | return this.authHttp.delete(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.uuid) | 66 | return this.authHttp.delete(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.uuid) |
59 | .pipe( | 67 | .pipe( |