Public API: Add routes to get uploads by user or note

Co-authored-by: Yannick Bungers <git@innay.de>
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-10-24 21:48:29 +02:00
parent 4f60a79e4b
commit 7563eb703d
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -148,6 +148,20 @@ paths:
"$ref": "#/components/schemas/NoteMetadata"
'401':
"$ref": "#/components/responses/UnauthorizedError"
/me/media:
get:
tags: [ user, media ]
summary: Get list of uploaded files owned by the current user
operationId: getOwnMedia
responses:
'200':
description:
content:
application/json:
schema:
type: array
items:
"$ref": "#/components/schemas/MediaUpload"
/notes:
post:
tags:
@ -454,6 +468,20 @@ paths:
content:
text/plain:
example: my-note
/notes/{note}/media:
get:
tags: [ note, media ]
summary: Get list of files uploaded to the note
operationId: getOwnMedia
responses:
'200':
description:
content:
application/json:
schema:
type: array
items:
"$ref": "#/components/schemas/MediaUpload"
/media:
post:
tags:
@ -828,6 +856,22 @@ components:
description: The array that contains history objects.
items:
"$ref": "#/components/schemas/HistoryObject"
MediaUpload:
type: object
properties:
note:
type: string
description: ID of the note the file was uploaded to
user:
type: string
description: username of the user who uploaded the file
url:
type: string
description: URL of the file
createdAt:
type: string
format: date-time
description: Date when the file was upladed
examples:
markdownExample:
value: '# Some header\nSome normal text. **Some bold text**'