- await video.$set('Tags', tagInstances, { transaction })
- video.Tags = tagInstances
- } else {
- video.Tags = defaultValue || []
- }
+ const internalTags = tags || []
+ const tagInstances = await TagModel.findOrCreateTags(internalTags, transaction)
+
+ await video.$set('Tags', tagInstances, { transaction })
+ video.Tags = tagInstances