Skip to content

Commit

Permalink
The endpoint GET /categories/{id}/subjects doesn't correspond to the …
Browse files Browse the repository at this point in the history
…actual endpoint GET /categories/subjects/names (#1065)

* changed endpoint for add categories button

* changed endpoint to actual

* returned unnececessary change for other endpoint

* returned endpoint and changed schema for new

* fixed comments

* fixed comments
  • Loading branch information
ArtemHolikov authored Dec 20, 2024
1 parent 9a1f9a8 commit 6fe58ff
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/category/category-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,12 @@ definitions:
updatedAt:
type: string
format: date-time
categoriesSubjectsNames:
type: array
items:
type: object
properties:
_id:
type: string
name:
type: string
36 changes: 36 additions & 0 deletions docs/category/category.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,42 @@ paths:
status: 401
code: UNAUTHORIZED
message: The requested URL requires user authorization.
/categories/subjects/names:
get:
security:
- cookieAuth: []
tags:
- Categories
summary: Finds and returns all subjects's names
description: Finds and returns names of all subjects in all categories.
produces:
- application/json
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/definitions/categoriesSubjectsNames'
example:
- _id: 6422dbb9823be47b41eeb8d6
name: Bass
- _id: 6422d995d898aa732d038e8f
name: Guitar
- _id: 6675859059019cd05eb119ff
name: Spanish
- _id: 6675878f59019cd05eb11a1e
name: Product Design
401:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/Error'
example:
status: 401
code: UNAUTHORIZED
message: The requested URL requires user authorization.
/categories/{id}:
get:
security:
Expand Down

0 comments on commit 6fe58ff

Please sign in to comment.