diff --git a/pages/api/custom-inputs/[id]/_delete.ts b/pages/api/custom-inputs/[id]/_delete.ts index 86e3fdaf86..747e1954ff 100644 --- a/pages/api/custom-inputs/[id]/_delete.ts +++ b/pages/api/custom-inputs/[id]/_delete.ts @@ -16,6 +16,12 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform * type: integer * required: true * description: ID of the eventTypeCustomInput to delete + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key * tags: * - custom-inputs * responses: diff --git a/pages/api/custom-inputs/[id]/_get.ts b/pages/api/custom-inputs/[id]/_get.ts index e79ad00c4e..96cb8133dc 100644 --- a/pages/api/custom-inputs/[id]/_get.ts +++ b/pages/api/custom-inputs/[id]/_get.ts @@ -17,6 +17,12 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform * type: integer * required: true * description: ID of the eventTypeCustomInput to get + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key * tags: * - custom-inputs * responses: diff --git a/pages/api/custom-inputs/[id]/_patch.ts b/pages/api/custom-inputs/[id]/_patch.ts index 860c347284..9ecdd822de 100644 --- a/pages/api/custom-inputs/[id]/_patch.ts +++ b/pages/api/custom-inputs/[id]/_patch.ts @@ -13,6 +13,44 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform * /custom-inputs/{id}: * patch: * summary: Edit an existing eventTypeCustomInput + * requestBody: + * description: Edit an existing eventTypeCustomInput for an event type + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * eventTypeId: + * type: integer + * description: 'ID of the event type to which the custom input is being added' + * label: + * type: string + * description: 'Label of the custom input' + * type: + * type: string + * description: 'Type of the custom input. The value is ENUM; one of [TEXT, TEXTLONG, NUMBER, BOOL, RADIO, PHONE]' + * options: + * type: object + * properties: + * label: + * type: string + * type: + * type: string + * description: 'Options for the custom input' + * required: + * type: boolean + * description: 'If the custom input is required before booking' + * placeholder: + * type: string + * description: 'Placeholder text for the custom input' + * + * examples: + * custom-inputs: + * summary: Example of patching an existing Custom Input + * value: + * required: true + * * parameters: * - in: path * name: id @@ -20,6 +58,13 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform * type: integer * required: true * description: ID of the eventTypeCustomInput to edit + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key + * * tags: * - custom-inputs * responses: diff --git a/pages/api/custom-inputs/_get.ts b/pages/api/custom-inputs/_get.ts index c08f9239c6..db63434ddf 100644 --- a/pages/api/custom-inputs/_get.ts +++ b/pages/api/custom-inputs/_get.ts @@ -10,6 +10,13 @@ import { schemaEventTypeCustomInputPublic } from "~/lib/validations/event-type-c * /custom-inputs: * get: * summary: Find all eventTypeCustomInputs + * parameters: + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key * tags: * - custom-inputs * responses: diff --git a/pages/api/custom-inputs/_post.ts b/pages/api/custom-inputs/_post.ts index 815ceff04c..56d15816a4 100644 --- a/pages/api/custom-inputs/_post.ts +++ b/pages/api/custom-inputs/_post.ts @@ -8,11 +8,72 @@ import { schemaEventTypeCustomInputPublic, } from "~/lib/validations/event-type-custom-input"; +// id: z.number().int(), +// eventTypeId: z.number().int(), +// label: z.string(), +// type: z.nativeEnum(EventTypeCustomInputType), +// required: z.boolean(), +// placeholder: z.string(), /** * @swagger * /custom-inputs: * post: * summary: Creates a new eventTypeCustomInput + * parameters: + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key + * requestBody: + * description: Create a new custom input for an event type + * required: true + * content: + * application/json: + * schema: + * type: object + * required: + * - eventTypeId + * - label + * - type + * - required + * - placeholder + * properties: + * eventTypeId: + * type: integer + * description: 'ID of the event type to which the custom input is being added' + * label: + * type: string + * description: 'Label of the custom input' + * type: + * type: string + * description: 'Type of the custom input. The value is ENUM; one of [TEXT, TEXTLONG, NUMBER, BOOL, RADIO, PHONE]' + * options: + * type: object + * properties: + * label: + * type: string + * type: + * type: string + * description: 'Options for the custom input' + * required: + * type: boolean + * description: 'If the custom input is required before booking' + * placeholder: + * type: string + * description: 'Placeholder text for the custom input' + * + * examples: + * custom-inputs: + * summary: An example of custom-inputs + * value: + * eventTypeID: 1 + * label: "Phone Number" + * type: "PHONE" + * required: true + * placeholder: "100 101 1234" + * * tags: * - custom-inputs * responses: