* Refactor swagger docs * Scaffold refactor * Refactor crud tasks * fixup! Refactor crud tasks * Break down task layout * fixup! Break down task layout * fixup! fixup! Break down task layout * Cleanup comments * fixup! Cleanup comments * Cleanup obsolete code * Remove helpers
173 lines
4.5 KiB
JavaScript
173 lines
4.5 KiB
JavaScript
/**
|
|
* @swagger
|
|
* /api/notes:
|
|
* get:
|
|
* summary: Get all notes
|
|
* tags: [Notes]
|
|
* security:
|
|
* - cookieAuth: []
|
|
* - BearerAuth: []
|
|
* parameters:
|
|
* - in: query
|
|
* name: order_by
|
|
* schema:
|
|
* type: string
|
|
* example: "title:asc"
|
|
* description: Sort order (field:direction)
|
|
* - in: query
|
|
* name: project_id
|
|
* schema:
|
|
* type: integer
|
|
* description: Filter by project ID
|
|
* responses:
|
|
* 200:
|
|
* description: List of notes
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: array
|
|
* items:
|
|
* $ref: '#/components/schemas/Note'
|
|
* 401:
|
|
* description: Unauthorized
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /api/note:
|
|
* post:
|
|
* summary: Create a new note
|
|
* tags: [Notes]
|
|
* security:
|
|
* - cookieAuth: []
|
|
* - BearerAuth: []
|
|
* requestBody:
|
|
* required: true
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* required:
|
|
* - title
|
|
* - content
|
|
* properties:
|
|
* title:
|
|
* type: string
|
|
* description: Note title
|
|
* example: "Meeting notes"
|
|
* content:
|
|
* type: string
|
|
* description: Note content (Markdown supported)
|
|
* example: "# Meeting Summary\n- Point 1\n- Point 2"
|
|
* color:
|
|
* type: string
|
|
* description: Background color (hex)
|
|
* example: "#B71C1C"
|
|
* project_uid:
|
|
* type: string
|
|
* description: Associated project UID
|
|
* tags:
|
|
* type: array
|
|
* items:
|
|
* type: string
|
|
* description: Array of tag names
|
|
* responses:
|
|
* 201:
|
|
* description: Note created successfully
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* $ref: '#/components/schemas/Note'
|
|
* 400:
|
|
* description: Invalid request
|
|
* 401:
|
|
* description: Unauthorized
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /api/note/{uid}:
|
|
* patch:
|
|
* summary: Update a note
|
|
* tags: [Notes]
|
|
* security:
|
|
* - cookieAuth: []
|
|
* - BearerAuth: []
|
|
* parameters:
|
|
* - in: path
|
|
* name: uid
|
|
* required: true
|
|
* schema:
|
|
* type: string
|
|
* description: Note UID
|
|
* requestBody:
|
|
* required: true
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* title:
|
|
* type: string
|
|
* description: Note title
|
|
* content:
|
|
* type: string
|
|
* description: Note content (Markdown supported)
|
|
* color:
|
|
* type: string
|
|
* description: Background color (hex)
|
|
* project_uid:
|
|
* type: string
|
|
* description: Associated project UID
|
|
* tags:
|
|
* type: array
|
|
* items:
|
|
* type: string
|
|
* description: Array of tag names
|
|
* responses:
|
|
* 200:
|
|
* description: Note updated successfully
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* $ref: '#/components/schemas/Note'
|
|
* 400:
|
|
* description: Invalid request
|
|
* 401:
|
|
* description: Unauthorized
|
|
* 404:
|
|
* description: Note not found
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /api/note/{uid}:
|
|
* delete:
|
|
* summary: Delete a note
|
|
* tags: [Notes]
|
|
* security:
|
|
* - cookieAuth: []
|
|
* - BearerAuth: []
|
|
* parameters:
|
|
* - in: path
|
|
* name: uid
|
|
* required: true
|
|
* schema:
|
|
* type: string
|
|
* description: Note UID
|
|
* responses:
|
|
* 200:
|
|
* description: Note deleted successfully
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* message:
|
|
* type: string
|
|
* example: "Note deleted successfully."
|
|
* 401:
|
|
* description: Unauthorized
|
|
* 404:
|
|
* description: Note not found
|
|
*/
|