mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
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
This commit is contained in:
committed by
Chocobozzz
parent
8ce1ba6e3e
commit
c100a6142e
@@ -1344,6 +1344,35 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/VideoChannel'
|
||||
'/accounts/{name}/ratings':
|
||||
get:
|
||||
summary: Get ratings of an account by its name
|
||||
security:
|
||||
- OAuth2: []
|
||||
tags:
|
||||
- User
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/start'
|
||||
- $ref: '#/components/parameters/count'
|
||||
- $ref: '#/components/parameters/sort'
|
||||
- name: rating
|
||||
in: query
|
||||
required: false
|
||||
description: Optionaly filter which ratings to retrieve
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- like
|
||||
- dislike
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/VideoRating'
|
||||
'/videos/{id}/comment-threads':
|
||||
get:
|
||||
summary: Get the comment threads of a video by its id
|
||||
@@ -2142,6 +2171,16 @@ components:
|
||||
required:
|
||||
- id
|
||||
- rating
|
||||
VideoRating:
|
||||
properties:
|
||||
video:
|
||||
$ref: '#/components/schemas/Video'
|
||||
rating:
|
||||
type: number
|
||||
description: 'Rating of the video'
|
||||
required:
|
||||
- video
|
||||
- rating
|
||||
RegisterUser:
|
||||
properties:
|
||||
username:
|
||||
|
||||
Reference in New Issue
Block a user