diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-07 14:32:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 14:32:36 +0100 |
commit | 2d53be0267acc49cda46707b885096193a1f4e9c (patch) | |
tree | 887061a34bc67f40acbb96a6278f9544bf83caeb /server/controllers/api/videos/rate.ts | |
parent | adc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff) | |
download | PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.gz PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.zst PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.zip |
replace numbers with typed http status codes (#3409)
Diffstat (limited to 'server/controllers/api/videos/rate.ts')
-rw-r--r-- | server/controllers/api/videos/rate.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts index df1eddb4f..520932c63 100644 --- a/server/controllers/api/videos/rate.ts +++ b/server/controllers/api/videos/rate.ts | |||
@@ -7,6 +7,7 @@ import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUp | |||
7 | import { AccountModel } from '../../../models/account/account' | 7 | import { AccountModel } from '../../../models/account/account' |
8 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' | 8 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' |
9 | import { sequelizeTypescript } from '../../../initializers/database' | 9 | import { sequelizeTypescript } from '../../../initializers/database' |
10 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
10 | 11 | ||
11 | const rateVideoRouter = express.Router() | 12 | const rateVideoRouter = express.Router() |
12 | 13 | ||
@@ -78,5 +79,7 @@ async function rateVideo (req: express.Request, res: express.Response) { | |||
78 | logger.info('Account video rate for video %s of account %s updated.', videoInstance.name, accountInstance.name) | 79 | logger.info('Account video rate for video %s of account %s updated.', videoInstance.name, accountInstance.name) |
79 | }) | 80 | }) |
80 | 81 | ||
81 | return res.type('json').status(204).end() | 82 | return res.type('json') |
83 | .status(HttpStatusCode.NO_CONTENT_204) | ||
84 | .end() | ||
82 | } | 85 | } |