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

View File

@ -7,7 +7,8 @@ import type {
WorkflowCommentDetail as ContractWorkflowCommentDetail, WorkflowCommentDetail as ContractWorkflowCommentDetail,
WorkflowCommentDetailReply as ContractWorkflowCommentDetailReply, WorkflowCommentDetailReply as ContractWorkflowCommentDetailReply,
WorkflowCommentList as ContractWorkflowCommentList, WorkflowCommentList as ContractWorkflowCommentList,
WorkflowCommentReply as ContractWorkflowCommentReply, WorkflowCommentReplyCreateRes as ContractWorkflowCommentReplyCreateRes,
WorkflowCommentReplyUpdateRes as ContractWorkflowCommentReplyUpdateRes,
WorkflowCommentResolveRes as ContractWorkflowCommentResolveRes, WorkflowCommentResolveRes as ContractWorkflowCommentResolveRes,
WorkflowCommentUpdateRes as ContractWorkflowCommentUpdateRes, WorkflowCommentUpdateRes as ContractWorkflowCommentUpdateRes,
} from '@/contract/console/workflow-comment' } from '@/contract/console/workflow-comment'
@ -22,7 +23,8 @@ type WorkflowCommentCreateRes = ContractWorkflowCommentCreateRes
export type WorkflowCommentDetail = ContractWorkflowCommentDetail export type WorkflowCommentDetail = ContractWorkflowCommentDetail
export type WorkflowCommentDetailReply = ContractWorkflowCommentDetailReply export type WorkflowCommentDetailReply = ContractWorkflowCommentDetailReply
export type WorkflowCommentList = ContractWorkflowCommentList export type WorkflowCommentList = ContractWorkflowCommentList
type WorkflowCommentReply = ContractWorkflowCommentReply type WorkflowCommentReplyCreateRes = ContractWorkflowCommentReplyCreateRes
type WorkflowCommentReplyUpdateRes = ContractWorkflowCommentReplyUpdateRes
type WorkflowCommentResolveRes = ContractWorkflowCommentResolveRes type WorkflowCommentResolveRes = ContractWorkflowCommentResolveRes
type WorkflowCommentUpdateRes = ContractWorkflowCommentUpdateRes 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({ return consoleClient.workflowComments.replies.create({
params: { appId, commentId }, params: { appId, commentId },
body: params, 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({ return consoleClient.workflowComments.replies.update({
params: { params: {
appId, appId,