diff options
Diffstat (limited to 'client/src/app/videos/shared')
-rw-r--r-- | client/src/app/videos/shared/rate-type.type.ts | 1 | ||||
-rw-r--r-- | client/src/app/videos/shared/video.service.ts | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/client/src/app/videos/shared/rate-type.type.ts b/client/src/app/videos/shared/rate-type.type.ts deleted file mode 100644 index 20eea3ae5..000000000 --- a/client/src/app/videos/shared/rate-type.type.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export type RateType = 'like' | 'dislike' | ||
diff --git a/client/src/app/videos/shared/video.service.ts b/client/src/app/videos/shared/video.service.ts index a4e3d16df..977b82118 100644 --- a/client/src/app/videos/shared/video.service.ts +++ b/client/src/app/videos/shared/video.service.ts | |||
@@ -6,7 +6,6 @@ import 'rxjs/add/operator/map' | |||
6 | 6 | ||
7 | import { Search } from '../../shared' | 7 | import { Search } from '../../shared' |
8 | import { SortField } from './sort-field.type' | 8 | import { SortField } from './sort-field.type' |
9 | import { RateType } from './rate-type.type' | ||
10 | import { AuthService } from '../../core' | 9 | import { AuthService } from '../../core' |
11 | import { | 10 | import { |
12 | AuthHttp, | 11 | AuthHttp, |
@@ -17,6 +16,7 @@ import { | |||
17 | UserService | 16 | UserService |
18 | } from '../../shared' | 17 | } from '../../shared' |
19 | import { Video } from './video.model' | 18 | import { Video } from './video.model' |
19 | import { VideoRateType } from '../../../../../shared' | ||
20 | 20 | ||
21 | @Injectable() | 21 | @Injectable() |
22 | export class VideoService { | 22 | export class VideoService { |
@@ -145,7 +145,7 @@ export class VideoService { | |||
145 | return this.setVideoRate(id, 'dislike') | 145 | return this.setVideoRate(id, 'dislike') |
146 | } | 146 | } |
147 | 147 | ||
148 | getUserVideoRating (id: string) { | 148 | getUserVideoRating (id: string): Observable<VideoRateType> { |
149 | const url = UserService.BASE_USERS_URL + '/me/videos/' + id + '/rating' | 149 | const url = UserService.BASE_USERS_URL + '/me/videos/' + id + '/rating' |
150 | 150 | ||
151 | return this.authHttp.get(url) | 151 | return this.authHttp.get(url) |
@@ -159,7 +159,7 @@ export class VideoService { | |||
159 | .catch((res) => this.restExtractor.handleError(res)) | 159 | .catch((res) => this.restExtractor.handleError(res)) |
160 | } | 160 | } |
161 | 161 | ||
162 | private setVideoRate (id: string, rateType: RateType) { | 162 | private setVideoRate (id: string, rateType: VideoRateType) { |
163 | const url = VideoService.BASE_VIDEO_URL + id + '/rate' | 163 | const url = VideoService.BASE_VIDEO_URL + id + '/rate' |
164 | const body = { | 164 | const body = { |
165 | rating: rateType | 165 | rating: rateType |