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:
get:
summary: Get a list of assets which a article uses
summary: Get a list of assets
parameters:
- in: query
name: article_id
name: q
schema:
type: number
description: Id of the article to get the assets from
type: string
description: Name of assets to search
security:
- cookie: []
responses:
@@ -308,8 +308,6 @@ paths:
$ref: '#/components/schemas/Asset'
401:
description: Not authorized
404:
description: Article was not found
post:
summary: Adds a new asset to an article
requestBody:
@@ -318,9 +316,6 @@ paths:
schema:
type: object
properties:
article_id:
type: number
description: Id of the article to store the asset to
name:
type: string
description: Name of the asset
@@ -339,36 +334,7 @@ paths:
401:
description: Not authorized
409:
description: A asset with the same name for the same article 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
description: A asset with the same name already exists
delete:
summary: Deletes assets
requestBody: