Skip to content

Commit

Permalink
feat:チーム削除のスキーマを定義
Browse files Browse the repository at this point in the history
  • Loading branch information
speak-mentaiko committed Sep 7, 2024
1 parent f670f2b commit 9e978a5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/kcms/src/team/adaptor/validator/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,13 @@ export const PostTeamsRequestSchema = z.array(
);

export const PostTeamsResponseSchema = z.array(TeamSchema).openapi('Teams');

export const TeamIdParamsSchema = z.object({
teamid: z.string().openapi({
param: {
name: 'teamid',
in: 'path',
},
example: '7549586',
}),
});
22 changes: 22 additions & 0 deletions packages/kcms/src/team/routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
CommonErrorSchema,
PostTeamsRequestSchema,
PostTeamsResponseSchema,
TeamIdParamsSchema,
} from './adaptor/validator/team';

export const GetTeamsRoute = createRoute({
Expand Down Expand Up @@ -61,3 +62,24 @@ export const PostTeamsRoute = createRoute({
},
},
});

export const DeleteTeamRoute = createRoute({
method: 'delete',
path: '/team/{teamid}',
request: {
params: TeamIdParamsSchema,
},
responses: {
204: {
description: 'Delete Team',
},
400: {
content: {
'application/json': {
schema: CommonErrorSchema,
},
},
description: 'Common Error',
},
},
});

0 comments on commit 9e978a5

Please sign in to comment.