aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/shared
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-17 11:28:11 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-17 11:28:11 +0200
commit154898b0b7bc1af41fc5a94974e338a3590c90f3 (patch)
tree5fb90f66da7587aed53c99ac1884c7acd0c1f7ca /client/src/app/videos/shared
parentdf98563e2104b82b119c00a3cd83cd0dc1242d25 (diff)
downloadPeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.tar.gz
PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.tar.zst
PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.zip
Share models between server and client
Diffstat (limited to 'client/src/app/videos/shared')
-rw-r--r--client/src/app/videos/shared/rate-type.type.ts1
-rw-r--r--client/src/app/videos/shared/video.service.ts6
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 @@
1export 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
7import { Search } from '../../shared' 7import { Search } from '../../shared'
8import { SortField } from './sort-field.type' 8import { SortField } from './sort-field.type'
9import { RateType } from './rate-type.type'
10import { AuthService } from '../../core' 9import { AuthService } from '../../core'
11import { 10import {
12 AuthHttp, 11 AuthHttp,
@@ -17,6 +16,7 @@ import {
17 UserService 16 UserService
18} from '../../shared' 17} from '../../shared'
19import { Video } from './video.model' 18import { Video } from './video.model'
19import { VideoRateType } from '../../../../../shared'
20 20
21@Injectable() 21@Injectable()
22export class VideoService { 22export 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