Optimized assets endpoint

This commit is contained in:
2022-01-24 11:36:10 +01:00
parent bfabac80ca
commit 60dccb5e69

View File

@@ -288,13 +288,13 @@ paths:
/api/assets: /api/assets:
get: get:
summary: Get a list of assets which a article uses summary: Get a list of assets
parameters: parameters:
- in: query - in: query
name: article_id name: q
schema: schema:
type: number type: string
description: Id of the article to get the assets from description: Name of assets to search
security: security:
- cookie: [] - cookie: []
responses: responses:
@@ -308,8 +308,6 @@ paths:
$ref: '#/components/schemas/Asset' $ref: '#/components/schemas/Asset'
401: 401:
description: Not authorized description: Not authorized
404:
description: Article was not found
post: post:
summary: Adds a new asset to an article summary: Adds a new asset to an article
requestBody: requestBody:
@@ -318,9 +316,6 @@ paths:
schema: schema:
type: object type: object
properties: properties:
article_id:
type: number
description: Id of the article to store the asset to
name: name:
type: string type: string
description: Name of the asset description: Name of the asset
@@ -339,36 +334,7 @@ paths:
401: 401:
description: Not authorized description: Not authorized
409: 409:
description: A asset with the same name for the same article already exists description: A asset with the same name already exists
patch:
summary: Changes an asset name. This impacts its alt tag and the link to it
requestBody:
content:
application/json:
schema:
type: object
properties:
id:
type: number
description: Id of the asset
name:
type: string
description: New name of the asset
security:
- cookie: []
responses:
200:
description: The asset name was changed successfully
content:
application/json:
schema:
$ref: '#/components/schemas/Asset'
401:
description: Not authorized
404:
description: An asset with this id does not exist
409:
description: A asset with the same name for the same article already exists
delete: delete:
summary: Deletes assets summary: Deletes assets
requestBody: requestBody: