aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-14 11:18:49 +0100
committerChocobozzz <me@florianbigard.com>2017-12-19 10:51:09 +0100
commitfadf619ad61a016c1c7fc53de5a8f398a4f77519 (patch)
treebd449b9fe2353d812f4cf57f6dd03c2221b25607 /server/controllers/api
parent7efe153b0bc23e596d5019b9fb3e3e32b6cfeccd (diff)
downloadPeerTube-fadf619ad61a016c1c7fc53de5a8f398a4f77519.tar.gz
PeerTube-fadf619ad61a016c1c7fc53de5a8f398a4f77519.tar.zst
PeerTube-fadf619ad61a016c1c7fc53de5a8f398a4f77519.zip
Save
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/server/follows.ts2
-rw-r--r--server/controllers/api/videos/channel.ts11
2 files changed, 6 insertions, 7 deletions
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:
157 // This could be long so don't wait this task 157 // This could be long so don't wait this task
158 const following = follow.AccountFollowing 158 const following = follow.AccountFollowing
159 following.destroy() 159 following.destroy()
160 .catch(err => logger.error('Cannot destroy account that we do not follow anymore %s.', following.url, err)) 160 .catch(err => logger.error('Cannot destroy account that we do not follow anymore %s.', following.Actor.url, err))
161 161
162 return res.status(204).end() 162 return res.status(204).end()
163} 163}
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
92 return res.type('json').status(204).end() 92 return res.type('json').status(204).end()
93} 93}
94 94
95async function addVideoChannel (req: express.Request, res: express.Response) { 95function addVideoChannel (req: express.Request, res: express.Response) {
96 const videoChannelInfo: VideoChannelCreate = req.body 96 const videoChannelInfo: VideoChannelCreate = req.body
97 const account: AccountModel = res.locals.oauth.token.User.Account 97 const account: AccountModel = res.locals.oauth.token.User.Account
98 let videoChannelCreated: VideoChannelModel
99 98
100 await sequelizeTypescript.transaction(async t => { 99 return sequelizeTypescript.transaction(async t => {
101 videoChannelCreated = await createVideoChannel(videoChannelInfo, account, t) 100 const videoChannelCreated = await createVideoChannel(videoChannelInfo, account, t)
102 })
103 101
104 logger.info('Video channel with uuid %s created.', videoChannelCreated.uuid) 102 logger.info('Video channel with uuid %s created.', videoChannelCreated.uuid)
103 })
105} 104}
106 105
107async function updateVideoChannelRetryWrapper (req: express.Request, res: express.Response, next: express.NextFunction) { 106async function updateVideoChannelRetryWrapper (req: express.Request, res: express.Response, next: express.NextFunction) {