From 154898b0b7bc1af41fc5a94974e338a3590c90f3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sat, 17 Jun 2017 11:28:11 +0200 Subject: Share models between server and client --- client/src/app/videos/shared/rate-type.type.ts | 1 - client/src/app/videos/shared/video.service.ts | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 client/src/app/videos/shared/rate-type.type.ts (limited to 'client/src/app/videos/shared') 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 @@ -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' import { Search } from '../../shared' import { SortField } from './sort-field.type' -import { RateType } from './rate-type.type' import { AuthService } from '../../core' import { AuthHttp, @@ -17,6 +16,7 @@ import { UserService } from '../../shared' import { Video } from './video.model' +import { VideoRateType } from '../../../../../shared' @Injectable() export class VideoService { @@ -145,7 +145,7 @@ export class VideoService { return this.setVideoRate(id, 'dislike') } - getUserVideoRating (id: string) { + getUserVideoRating (id: string): Observable { const url = UserService.BASE_USERS_URL + '/me/videos/' + id + '/rating' return this.authHttp.get(url) @@ -159,7 +159,7 @@ export class VideoService { .catch((res) => this.restExtractor.handleError(res)) } - private setVideoRate (id: string, rateType: RateType) { + private setVideoRate (id: string, rateType: VideoRateType) { const url = VideoService.BASE_VIDEO_URL + id + '/rate' const body = { rating: rateType -- cgit v1.2.3