fix(web): align workflow comment reply contract outputs

This commit is contained in:
hjlarry 2026-04-12 16:28:25 +08:00
parent 977af3399e
commit 0acd329e6d
2 changed files with 13 additions and 17 deletions

View File

@ -75,20 +75,14 @@ export type WorkflowCommentResolveRes = {
resolved_at: number
}
export type WorkflowCommentReply = {
export type WorkflowCommentReplyCreateRes = {
id: string
comment_id: string
content: string
created_by: string
created_at: string
}
export type WorkflowCommentReplyUpdateRes = {
id: string
updated_at: string
mentioned_user_ids: string[]
author: {
id: string
name: string
email: string
avatar?: string
}
}
export type CreateCommentParams = {
@ -200,7 +194,7 @@ const workflowCommentReplyCreateContract = base
}
body: CreateReplyParams
}>())
.output(type<WorkflowCommentReply>())
.output(type<WorkflowCommentReplyCreateRes>())
const workflowCommentReplyUpdateContract = base
.route({
@ -215,7 +209,7 @@ const workflowCommentReplyUpdateContract = base
}
body: CreateReplyParams
}>())
.output(type<WorkflowCommentReply>())
.output(type<WorkflowCommentReplyUpdateRes>())
const workflowCommentReplyDeleteContract = base
.route({

View File

@ -7,7 +7,8 @@ import type {
WorkflowCommentDetail as ContractWorkflowCommentDetail,
WorkflowCommentDetailReply as ContractWorkflowCommentDetailReply,
WorkflowCommentList as ContractWorkflowCommentList,
WorkflowCommentReply as ContractWorkflowCommentReply,
WorkflowCommentReplyCreateRes as ContractWorkflowCommentReplyCreateRes,
WorkflowCommentReplyUpdateRes as ContractWorkflowCommentReplyUpdateRes,
WorkflowCommentResolveRes as ContractWorkflowCommentResolveRes,
WorkflowCommentUpdateRes as ContractWorkflowCommentUpdateRes,
} from '@/contract/console/workflow-comment'
@ -22,7 +23,8 @@ type WorkflowCommentCreateRes = ContractWorkflowCommentCreateRes
export type WorkflowCommentDetail = ContractWorkflowCommentDetail
export type WorkflowCommentDetailReply = ContractWorkflowCommentDetailReply
export type WorkflowCommentList = ContractWorkflowCommentList
type WorkflowCommentReply = ContractWorkflowCommentReply
type WorkflowCommentReplyCreateRes = ContractWorkflowCommentReplyCreateRes
type WorkflowCommentReplyUpdateRes = ContractWorkflowCommentReplyUpdateRes
type WorkflowCommentResolveRes = ContractWorkflowCommentResolveRes
type WorkflowCommentUpdateRes = ContractWorkflowCommentUpdateRes
@ -65,14 +67,14 @@ export const resolveWorkflowComment = async (appId: string, commentId: string):
})
}
export const createWorkflowCommentReply = async (appId: string, commentId: string, params: CreateReplyParams): Promise<WorkflowCommentReply> => {
export const createWorkflowCommentReply = async (appId: string, commentId: string, params: CreateReplyParams): Promise<WorkflowCommentReplyCreateRes> => {
return consoleClient.workflowComments.replies.create({
params: { appId, commentId },
body: params,
})
}
export const updateWorkflowCommentReply = async (appId: string, commentId: string, replyId: string, params: CreateReplyParams): Promise<WorkflowCommentReply> => {
export const updateWorkflowCommentReply = async (appId: string, commentId: string, replyId: string, params: CreateReplyParams): Promise<WorkflowCommentReplyUpdateRes> => {
return consoleClient.workflowComments.replies.update({
params: {
appId,