Skip to content

Commit

Permalink
⚡ Open Api file updated
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Jul 24, 2024
1 parent d99a373 commit 9903d82
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 70 deletions.
35 changes: 35 additions & 0 deletions packages/api/src/ticketing/comment/comment.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Headers,
Param,
Post,
Put,
Query,
UseGuards,
UsePipes,
Expand Down Expand Up @@ -166,4 +167,38 @@ export class CommentController {
throw new Error(error);
}
}

@ApiOperation({
operationId: 'updateComment',
summary: 'Update a Comment',
description: 'Update a comment in any supported Ticketing software',
})
@ApiHeader({
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
})
@ApiQuery({
name: 'remote_data',
required: false,
type: Boolean,
description:
'Set to true to include data from the original Ticketing software.',
})
@ApiBody({ type: UnifiedCommentInput })
@ApiCustomResponse(UnifiedCommentOutput)
@UseGuards(ApiKeyAuthGuard)
@Put()
async updateComment(
@Body() unfiedCommentData: UnifiedCommentInput,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
return;
} catch (error) {
throw new Error(error);
}
}
}
34 changes: 0 additions & 34 deletions packages/api/src/ticketing/ticket/ticket.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,38 +165,4 @@ export class TicketController {
throw new Error(error);
}
}

@ApiOperation({
operationId: 'updateTicket',
summary: 'Update a Ticket',
description: 'Update a ticket in any supported Ticketing software',
})
@ApiHeader({
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
})
@ApiQuery({
name: 'remote_data',
required: false,
type: Boolean,
description:
'Set to true to include data from the original Ticketing software.',
})
@ApiBody({ type: UnifiedTicketInput })
@ApiCustomResponse(UnifiedTicketOutput)
@UseGuards(ApiKeyAuthGuard)
@Put()
async updateTicket(
@Body() unfiedTicketData: UnifiedTicketInput,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
return;
} catch (error) {
throw new Error(error);
}
}
}
72 changes: 36 additions & 36 deletions packages/api/swagger/swagger-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -434,42 +434,6 @@ paths:
$ref: '#/components/schemas/UnifiedTicketOutput'
tags: *ref_4
security: *ref_5
put:
operationId: updateTicket
summary: Update a Ticket
description: Update a ticket in any supported Ticketing software
parameters:
- name: x-connection-token
required: true
in: header
description: The connection token
schema:
type: string
- name: remote_data
required: false
in: query
description: Set to true to include data from the original Ticketing software.
schema:
type: boolean
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UnifiedTicketInput'
responses:
'200':
description: ''
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ApiResponse'
- properties:
data:
$ref: '#/components/schemas/UnifiedTicketOutput'
tags: *ref_4
security: *ref_5
/ticketing/tickets/{id}:
get:
operationId: getTicket
Expand Down Expand Up @@ -1856,6 +1820,42 @@ paths:
$ref: '#/components/schemas/UnifiedCommentOutput'
tags: *ref_31
security: *ref_32
put:
operationId: updateComment
summary: Update a Comment
description: Update a comment in any supported Ticketing software
parameters:
- name: x-connection-token
required: true
in: header
description: The connection token
schema:
type: string
- name: remote_data
required: false
in: query
description: Set to true to include data from the original Ticketing software.
schema:
type: boolean
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UnifiedCommentInput'
responses:
'200':
description: ''
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ApiResponse'
- properties:
data:
$ref: '#/components/schemas/UnifiedCommentOutput'
tags: *ref_31
security: *ref_32
/ticketing/comments/{id}:
get:
operationId: getComment
Expand Down

0 comments on commit 9903d82

Please sign in to comment.