Adds swagger for schedules (#247)
This PR updates swagger documentation for the Schedules endpoint
This commit is contained in:
@@ -17,6 +17,12 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform
|
||||
* type: integer
|
||||
* required: true
|
||||
* description: ID of the schedule to delete
|
||||
* - in: query
|
||||
* name: apiKey
|
||||
* schema:
|
||||
* type: string
|
||||
* required: true
|
||||
* description: Your API Key
|
||||
* tags:
|
||||
* - schedules
|
||||
* responses:
|
||||
|
||||
@@ -18,6 +18,12 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform
|
||||
* type: integer
|
||||
* required: true
|
||||
* description: ID of the schedule to get
|
||||
* - in: query
|
||||
* name: apiKey
|
||||
* schema:
|
||||
* type: string
|
||||
* required: true
|
||||
* description: Your API Key
|
||||
* tags:
|
||||
* - schedules
|
||||
* responses:
|
||||
|
||||
@@ -20,6 +20,26 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform
|
||||
* type: integer
|
||||
* required: true
|
||||
* description: ID of the schedule to edit
|
||||
* - in: query
|
||||
* name: apiKey
|
||||
* schema:
|
||||
* type: string
|
||||
* required: true
|
||||
* description: Your API Key
|
||||
* requestBody:
|
||||
* description: Create a new schedule
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* name:
|
||||
* type: string
|
||||
* description: Name of the schedule
|
||||
* timezone:
|
||||
* type: string
|
||||
* description: The timezone for this schedule
|
||||
* tags:
|
||||
* - schedules
|
||||
* responses:
|
||||
|
||||
@@ -18,6 +18,13 @@ export const schemaUserIds = z
|
||||
* get:
|
||||
* operationId: listSchedules
|
||||
* summary: Find all schedules
|
||||
* parameters:
|
||||
* - in: query
|
||||
* name: apiKey
|
||||
* schema:
|
||||
* type: string
|
||||
* required: true
|
||||
* description: Your API Key
|
||||
* tags:
|
||||
* - schedules
|
||||
* responses:
|
||||
|
||||
@@ -13,6 +13,30 @@ import { schemaCreateScheduleBodyParams, schemaSchedulePublic } from "~/lib/vali
|
||||
* post:
|
||||
* operationId: addSchedule
|
||||
* summary: Creates a new schedule
|
||||
* parameters:
|
||||
* - in: query
|
||||
* name: apiKey
|
||||
* schema:
|
||||
* type: string
|
||||
* required: true
|
||||
* description: Your API Key
|
||||
* requestBody:
|
||||
* description: Create a new schedule
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* required:
|
||||
* - name
|
||||
* - timezone
|
||||
* properties:
|
||||
* name:
|
||||
* type: string
|
||||
* description: Name of the schedule
|
||||
* timezone:
|
||||
* type: string
|
||||
* description: The timezone for this schedule
|
||||
* tags:
|
||||
* - schedules
|
||||
* responses:
|
||||
@@ -23,6 +47,12 @@ import { schemaCreateScheduleBodyParams, schemaSchedulePublic } from "~/lib/vali
|
||||
* 401:
|
||||
* description: Authorization information is missing or invalid.
|
||||
*/
|
||||
|
||||
|
||||
eventType EventType[]
|
||||
name String
|
||||
timeZone String?
|
||||
availability Availability[]
|
||||
async function postHandler(req: NextApiRequest) {
|
||||
const { userId, isAdmin, prisma } = req;
|
||||
const body = schemaCreateScheduleBodyParams.parse(req.body);
|
||||
|
||||
Reference in New Issue
Block a user