}
updateVideo(video: Video) {
+ const language = video.language ? video.language : null;
+
const body = {
name: video.name,
category: video.category,
licence: video.licence,
- language: video.language,
+ language,
description: video.description,
tags: video.tags
};
+
const headers = new Headers({ 'Content-Type': 'application/json' });
const options = new RequestOptions({ headers: headers });
transaction: t
}
- if (videoInfosToUpdate.name) videoInstance.set('name', videoInfosToUpdate.name)
- if (videoInfosToUpdate.category) videoInstance.set('category', videoInfosToUpdate.category)
- if (videoInfosToUpdate.licence) videoInstance.set('licence', videoInfosToUpdate.licence)
- if (videoInfosToUpdate.language) videoInstance.set('language', videoInfosToUpdate.language)
- if (videoInfosToUpdate.nsfw) videoInstance.set('nsfw', videoInfosToUpdate.nsfw)
- if (videoInfosToUpdate.description) videoInstance.set('description', videoInfosToUpdate.description)
+ if (videoInfosToUpdate.name !== undefined) videoInstance.set('name', videoInfosToUpdate.name)
+ if (videoInfosToUpdate.category !== undefined) videoInstance.set('category', videoInfosToUpdate.category)
+ if (videoInfosToUpdate.licence !== undefined) videoInstance.set('licence', videoInfosToUpdate.licence)
+ if (videoInfosToUpdate.language !== undefined) videoInstance.set('language', videoInfosToUpdate.language)
+ if (videoInfosToUpdate.nsfw !== undefined) videoInstance.set('nsfw', videoInfosToUpdate.nsfw)
+ if (videoInfosToUpdate.description !== undefined) videoInstance.set('description', videoInfosToUpdate.description)
videoInstance.save(options).asCallback(function (err) {
return callback(err, t, tagInstances)