-
-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rename comment subscribe table name and generate migration
- Loading branch information
Showing
16 changed files
with
146 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
packages/openapi/src/comment/subscribe/create-subscribe.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { RouteConfig } from '@asteasolutions/zod-to-openapi'; | ||
import { axios } from '../../axios'; | ||
import { registerRoute, urlBuilder } from '../../utils'; | ||
import { z } from '../../zod'; | ||
|
||
export const CREATE_COMMENT_SUBSCRIBE = '/comment/{tableId}/{recordId}/subscribe'; | ||
|
||
export const CreateCommentSubscribeRoute: RouteConfig = registerRoute({ | ||
method: 'post', | ||
path: CREATE_COMMENT_SUBSCRIBE, | ||
description: "subscribe record comment's active", | ||
request: { | ||
params: z.object({ | ||
tableId: z.string(), | ||
recordId: z.string(), | ||
}), | ||
}, | ||
responses: { | ||
200: { | ||
description: 'Successfully subscribe record comment.', | ||
}, | ||
}, | ||
tags: ['comment'], | ||
}); | ||
|
||
export const createCommentSubscribe = async (tableId: string, recordId: string) => { | ||
return axios.post<void>(urlBuilder(CREATE_COMMENT_SUBSCRIBE, { tableId, recordId })); | ||
}; |
28 changes: 28 additions & 0 deletions
28
packages/openapi/src/comment/subscribe/delete-subscribe.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { RouteConfig } from '@asteasolutions/zod-to-openapi'; | ||
import { axios } from '../../axios'; | ||
import { registerRoute, urlBuilder } from '../../utils'; | ||
import { z } from '../../zod'; | ||
|
||
export const DELETE_COMMENT_SUBSCRIBE = '/comment/{tableId}/{recordId}/subscribe'; | ||
|
||
export const DeleteCommentSubscribeRoute: RouteConfig = registerRoute({ | ||
method: 'delete', | ||
path: DELETE_COMMENT_SUBSCRIBE, | ||
description: 'unsubscribe record comment', | ||
request: { | ||
params: z.object({ | ||
tableId: z.string(), | ||
recordId: z.string(), | ||
}), | ||
}, | ||
responses: { | ||
200: { | ||
description: 'Successfully subscribe record comment.', | ||
}, | ||
}, | ||
tags: ['comment'], | ||
}); | ||
|
||
export const deleteCommentSubscribe = async (tableId: string, recordId: string) => { | ||
return axios.delete<void>(urlBuilder(DELETE_COMMENT_SUBSCRIBE, { tableId, recordId })); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import type { RouteConfig } from '@asteasolutions/zod-to-openapi'; | ||
import { axios } from '../../axios'; | ||
import { registerRoute, urlBuilder } from '../../utils'; | ||
import { z } from '../../zod'; | ||
|
||
export const GET_COMMENT_SUBSCRIBE = '/comment/{tableId}/{recordId}/subscribe'; | ||
|
||
export const commentSubscribeVoSchema = z.object({ | ||
tableId: z.string(), | ||
recordId: z.string(), | ||
createdBy: z.string(), | ||
}); | ||
|
||
export type ICommentSubscribeVo = z.infer<typeof commentSubscribeVoSchema>; | ||
|
||
export const GetCommentSubscribeRoute: RouteConfig = registerRoute({ | ||
method: 'get', | ||
path: GET_COMMENT_SUBSCRIBE, | ||
description: 'get record comment subscribe detail', | ||
request: { | ||
params: z.object({ | ||
tableId: z.string(), | ||
recordId: z.string(), | ||
}), | ||
}, | ||
responses: { | ||
200: { | ||
description: 'Successfully get record comment subscribe detail.', | ||
}, | ||
}, | ||
tags: ['comment'], | ||
}); | ||
|
||
export const getCommentSubscribe = async (tableId: string, recordId: string) => { | ||
return axios.get<ICommentSubscribeVo>(urlBuilder(GET_COMMENT_SUBSCRIBE, { tableId, recordId })); | ||
}; |
Oops, something went wrong.