X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fvideo%2Fvideo.service.ts;h=91dd3977a733c049d31fc2d21ba7fb19eba6bc7a;hb=d48ff09d27d234425c3e9f091ae9072d8e6d8b7a;hp=3f35b67c42ab1a30190f1fa37f8dbb0c43287e27;hpb=f3aaa9a95cc2b61f1f255472d7014d08faa66561;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index 3f35b67c4..91dd3977a 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts @@ -9,9 +9,9 @@ import { UserVideoRateUpdate } from '../../../../../shared/models/videos/user-vi import { UserVideoRate } from '../../../../../shared/models/videos/user-video-rate.model' import { VideoRateType } from '../../../../../shared/models/videos/video-rate.type' import { VideoUpdate } from '../../../../../shared/models/videos/video-update.model' +import { environment } from '../../../environments/environment' import { RestExtractor } from '../rest/rest-extractor.service' import { RestService } from '../rest/rest.service' -import { Search } from '../header/search.model' import { UserService } from '../users/user.service' import { SortField } from './sort-field.type' import { VideoDetails } from './video-details.model' @@ -21,7 +21,7 @@ import { Video } from './video.model' @Injectable() export class VideoService { - private static BASE_VIDEO_URL = API_URL + '/api/v1/videos/' + private static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/' constructor ( private authHttp: HttpClient, @@ -42,14 +42,17 @@ export class VideoService { } updateVideo (video: VideoEdit) { - const language = video.language ? video.language : null + const language = video.language || undefined + const licence = video.licence || undefined + const category = video.category || undefined + const description = video.description || undefined const body: VideoUpdate = { name: video.name, - category: video.category, - licence: video.licence, + category, + licence, language, - description: video.description, + description, privacy: video.privacy, tags: video.tags, nsfw: video.nsfw @@ -115,7 +118,7 @@ export class VideoService { loadCompleteDescription (descriptionPath: string) { return this.authHttp - .get(API_URL + descriptionPath) + .get(environment.apiUrl + descriptionPath) .map(res => res['description']) .catch((res) => this.restExtractor.handleError(res)) }