Add /accounts/:username/ratings endpoint (#1756)
authorYohan Boniface <yohanboniface@free.fr>
Tue, 9 Apr 2019 09:02:02 +0000 (11:02 +0200)
committerChocobozzz <chocobozzz@cpy.re>
Tue, 9 Apr 2019 09:02:02 +0000 (11:02 +0200)
commitc100a6142e6571312db9f6407698a21a08b593fb
treec80ac9c7754b8f5b133255e003557937e415ee23
parent8ce1ba6e3efe0a688d6a0b57e8201cde33ad7aac
Add /accounts/:username/ratings endpoint (#1756)

* Add /users/me/videos/ratings endpoint

* Move ratings endpoint from users to accounts

* /accounts/:name/ratings: add support for rating= and sort=

* Restrict ratings list to owner

* Wording and better way to ensure current account
13 files changed:
server/controllers/api/accounts.ts
server/helpers/custom-validators/video-rates.ts [new file with mode: 0644]
server/initializers/constants.ts
server/middlewares/validators/sort.ts
server/middlewares/validators/users.ts
server/middlewares/validators/videos/video-rates.ts
server/models/account/account-video-rate.ts
server/tests/api/users/users.ts
shared/models/videos/index.ts
shared/models/videos/rate/account-video-rate.model.ts [new file with mode: 0644]
shared/utils/index.ts
shared/utils/users/accounts.ts
support/doc/api/openapi.yaml