diff options
Diffstat (limited to 'server/controllers/api/videos.js')
-rw-r--r-- | server/controllers/api/videos.js | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/server/controllers/api/videos.js b/server/controllers/api/videos.js index 6573b1210..df068f961 100644 --- a/server/controllers/api/videos.js +++ b/server/controllers/api/videos.js | |||
@@ -231,11 +231,12 @@ function addVideo (req, res, videoFile, callback) { | |||
231 | } | 231 | } |
232 | 232 | ||
233 | // Commit transaction | 233 | // Commit transaction |
234 | t.commit() | 234 | t.commit().asCallback(function (err) { |
235 | if (err) return callback(err) | ||
235 | 236 | ||
236 | logger.info('Video with name %s created.', videoInfos.name) | 237 | logger.info('Video with name %s created.', videoInfos.name) |
237 | 238 | return callback(null) | |
238 | return callback(null) | 239 | }) |
239 | }) | 240 | }) |
240 | } | 241 | } |
241 | 242 | ||
@@ -324,9 +325,12 @@ function updateVideo (req, res, finalCallback) { | |||
324 | } | 325 | } |
325 | 326 | ||
326 | // Commit transaction | 327 | // Commit transaction |
327 | t.commit() | 328 | t.commit().asCallback(function (err) { |
329 | if (err) return finalCallback(err) | ||
328 | 330 | ||
329 | return finalCallback(null) | 331 | logger.info('Video with name %s updated.', videoInfosToUpdate.name) |
332 | return finalCallback(null) | ||
333 | }) | ||
330 | }) | 334 | }) |
331 | } | 335 | } |
332 | 336 | ||
@@ -442,9 +446,12 @@ function reportVideoAbuse (req, res, finalCallback) { | |||
442 | } | 446 | } |
443 | 447 | ||
444 | // Commit transaction | 448 | // Commit transaction |
445 | t.commit() | 449 | t.commit().asCallback(function (err) { |
450 | if (err) return finalCallback(err) | ||
446 | 451 | ||
447 | return finalCallback(null) | 452 | logger.info('Abuse report for video %s created.', videoInstance.name) |
453 | return finalCallback(null) | ||
454 | }) | ||
448 | }) | 455 | }) |
449 | } | 456 | } |
450 | 457 | ||