]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-caption.ts
Playlist server API
[github/Chocobozzz/PeerTube.git] / server / models / video / video-caption.ts
index 10ef46c14ebac2cd87a599fc106e11013413ae9e..b4f17b481c8320dcc1e42ec6b801cf609621e47f 100644 (file)
@@ -120,7 +120,8 @@ export class VideoCaptionModel extends Model<VideoCaptionModel> {
       language
     }
 
-    return VideoCaptionModel.upsert(values, { transaction })
+    return VideoCaptionModel.upsert<VideoCaptionModel>(values, { transaction, returning: true })
+      .then(([ caption ]) => caption)
   }
 
   static listVideoCaptions (videoId: number) {