diff options
author | lutangar <johan.dufour@gmail.com> | 2021-11-24 14:33:14 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-11-25 09:54:22 +0100 |
commit | 7226e90fdc61a3c6cad5ccab18b6707d55cf0992 (patch) | |
tree | 0bdd7304352b1af2d9ae87439486a138e02d46e8 /server/controllers/api/videos/update.ts | |
parent | 5098098d96164c93f84ec8419e98fbd83ba8dc71 (diff) | |
download | PeerTube-7226e90fdc61a3c6cad5ccab18b6707d55cf0992.tar.gz PeerTube-7226e90fdc61a3c6cad5ccab18b6707d55cf0992.tar.zst PeerTube-7226e90fdc61a3c6cad5ccab18b6707d55cf0992.zip |
Add `req` and `res` as controllers hooks parameters
Hooks prefixed by `action:api` now give access the original express req and res.
Checkout guide.md for possible usage.
Diffstat (limited to 'server/controllers/api/videos/update.ts')
-rw-r--r-- | server/controllers/api/videos/update.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/controllers/api/videos/update.ts b/server/controllers/api/videos/update.ts index de5d94d55..3fcff3e86 100644 --- a/server/controllers/api/videos/update.ts +++ b/server/controllers/api/videos/update.ts | |||
@@ -153,7 +153,7 @@ async function updateVideo (req: express.Request, res: express.Response) { | |||
153 | Notifier.Instance.notifyOnNewVideoIfNeeded(videoInstanceUpdated) | 153 | Notifier.Instance.notifyOnNewVideoIfNeeded(videoInstanceUpdated) |
154 | } | 154 | } |
155 | 155 | ||
156 | Hooks.runAction('action:api.video.updated', { video: videoInstanceUpdated, body: req.body }) | 156 | Hooks.runAction('action:api.video.updated', { video: videoInstanceUpdated, body: req.body, req, res }) |
157 | } catch (err) { | 157 | } catch (err) { |
158 | // Force fields we want to update | 158 | // Force fields we want to update |
159 | // If the transaction is retried, sequelize will think the object has not changed | 159 | // If the transaction is retried, sequelize will think the object has not changed |