From 2efd32f697549c59337db5177a93749af8e605d8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 16 May 2018 09:28:18 +0200 Subject: Fix updating video tags to empty field --- server/controllers/api/videos/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/controllers/api/videos') diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index c07430e6c..bcf1eaee6 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -244,7 +244,7 @@ async function addVideo (req: express.Request, res: express.Response, videoPhysi video.VideoFiles = [ videoFile ] - if (videoInfo.tags) { + if (videoInfo.tags !== undefined) { const tagInstances = await TagModel.findOrCreateTags(videoInfo.tags, t) await video.$set('Tags', tagInstances, sequelizeOptions) @@ -332,7 +332,7 @@ async function updateVideo (req: express.Request, res: express.Response) { const videoInstanceUpdated = await videoInstance.save(sequelizeOptions) // Video tags update? - if (videoInfoToUpdate.tags) { + if (videoInfoToUpdate.tags !== undefined) { const tagInstances = await TagModel.findOrCreateTags(videoInfoToUpdate.tags, t) await videoInstanceUpdated.$set('Tags', tagInstances, sequelizeOptions) -- cgit v1.2.3