From fadf619ad61a016c1c7fc53de5a8f398a4f77519 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 14 Dec 2017 11:18:49 +0100 Subject: Save --- server/controllers/api/server/follows.ts | 2 +- server/controllers/api/videos/channel.ts | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/server/follows.ts b/server/controllers/api/server/follows.ts index 913998e3a..497edb8eb 100644 --- a/server/controllers/api/server/follows.ts +++ b/server/controllers/api/server/follows.ts @@ -157,7 +157,7 @@ async function removeFollow (req: express.Request, res: express.Response, next: // This could be long so don't wait this task const following = follow.AccountFollowing following.destroy() - .catch(err => logger.error('Cannot destroy account that we do not follow anymore %s.', following.url, err)) + .catch(err => logger.error('Cannot destroy account that we do not follow anymore %s.', following.Actor.url, err)) return res.status(204).end() } diff --git a/server/controllers/api/videos/channel.ts b/server/controllers/api/videos/channel.ts index 683b0448d..315469115 100644 --- a/server/controllers/api/videos/channel.ts +++ b/server/controllers/api/videos/channel.ts @@ -92,16 +92,15 @@ async function addVideoChannelRetryWrapper (req: express.Request, res: express.R return res.type('json').status(204).end() } -async function addVideoChannel (req: express.Request, res: express.Response) { +function addVideoChannel (req: express.Request, res: express.Response) { const videoChannelInfo: VideoChannelCreate = req.body const account: AccountModel = res.locals.oauth.token.User.Account - let videoChannelCreated: VideoChannelModel - await sequelizeTypescript.transaction(async t => { - videoChannelCreated = await createVideoChannel(videoChannelInfo, account, t) - }) + return sequelizeTypescript.transaction(async t => { + const videoChannelCreated = await createVideoChannel(videoChannelInfo, account, t) - logger.info('Video channel with uuid %s created.', videoChannelCreated.uuid) + logger.info('Video channel with uuid %s created.', videoChannelCreated.uuid) + }) } async function updateVideoChannelRetryWrapper (req: express.Request, res: express.Response, next: express.NextFunction) { -- cgit v1.2.3